From 72c5096ce9746ceafd30eb64767204698c3be964 Mon Sep 17 00:00:00 2001 From: "reed%reedloden.com" Date: Thu, 7 Feb 2008 19:49:18 +0000 Subject: [PATCH] Bug 411256 - "AIX linker error for trunk build xpcom module :ERROR: Undefined symbol: .PR_dtoa" (Remove standalone glue dependencies on NSPR) [p=benjamin@smedbergs.us (Benjamin Smedberg [bsmedberg]) r=dwitte a1.9=schrep] --- xpcom/glue/nsID.cpp | 3 +++ xpcom/glue/nsID.h | 4 ++++ xpcom/glue/nsTextFormatter.h | 3 +++ xpcom/glue/objs.mk | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/xpcom/glue/nsID.cpp b/xpcom/glue/nsID.cpp index 50f76a3af8f..e5a9133a1d3 100644 --- a/xpcom/glue/nsID.cpp +++ b/xpcom/glue/nsID.cpp @@ -118,6 +118,8 @@ PRBool nsID::Parse(const char *aIDStr) return expectFormat1 ? *aIDStr == '}' : PR_TRUE; } +#ifndef XPCOM_GLUE_AVOID_NSPR + /* * Returns an allocated string in {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} * format. The string is allocated with PR_Malloc and should be freed by @@ -147,3 +149,4 @@ void nsID::ToProvidedString(char (&dest)[NSID_LENGTH]) const (PRUint32) m3[6], (PRUint32) m3[7]); } +#endif // XPCOM_GLUE_AVOID_NSPR diff --git a/xpcom/glue/nsID.h b/xpcom/glue/nsID.h index 82c291285e7..994860fcf46 100644 --- a/xpcom/glue/nsID.h +++ b/xpcom/glue/nsID.h @@ -94,6 +94,7 @@ struct nsID { */ NS_COM_GLUE PRBool Parse(const char *aIDStr); +#ifndef XPCOM_GLUE_AVOID_NSPR /** * nsID string encoder. Returns an allocated string in * {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} format. Caller should free string. @@ -107,6 +108,9 @@ struct nsID { * buffer provided by the caller (for instance, on the stack). */ NS_COM_GLUE void ToProvidedString(char (&dest)[NSID_LENGTH]) const; + +#endif // XPCOM_GLUE_AVOID_NSPR + //@} }; diff --git a/xpcom/glue/nsTextFormatter.h b/xpcom/glue/nsTextFormatter.h index fe69151f12a..b10c889bfb4 100644 --- a/xpcom/glue/nsTextFormatter.h +++ b/xpcom/glue/nsTextFormatter.h @@ -69,6 +69,9 @@ #include "nscore.h" #include "nsStringGlue.h" +#ifdef XPCOM_GLUE +#error "nsTextFormatter is not available in the standalone glue due to NSPR dependencies." +#endif class NS_COM_GLUE nsTextFormatter { diff --git a/xpcom/glue/objs.mk b/xpcom/glue/objs.mk index 80118e1f98e..d6c7e9011da 100644 --- a/xpcom/glue/objs.mk +++ b/xpcom/glue/objs.mk @@ -65,7 +65,6 @@ XPCOM_GLUE_SRC_LCPPSRCS = \ nsTObserverArray.cpp \ nsCycleCollectionParticipant.cpp \ nsDeque.cpp \ - nsTextFormatter.cpp \ $(NULL) XPCOM_GLUE_SRC_CPPSRCS = $(addprefix $(topsrcdir)/xpcom/glue/, $(XPCOM_GLUE_SRC_LCPPSRCS)) @@ -78,6 +77,7 @@ XPCOM_GLUENS_SRC_LCPPSRCS = \ nsAutoLock.cpp \ nsGenericFactory.cpp \ nsProxyRelease.cpp \ + nsTextFormatter.cpp \ $(NULL) XPCOM_GLUENS_SRC_CPPSRCS = $(addprefix $(topsrcdir)/xpcom/glue/,$(XPCOM_GLUENS_SRC_LCPPSRCS))