From 81222970fe8f31348c8e2268582ecf9ddb12c3bc Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Fri, 3 Aug 2001 20:54:25 +0000 Subject: [PATCH] Working around dynamic linker restrictions on hp/macosx. r=dbaron/sr=brendan. bug# 93479 git-svn-id: svn://10.0.0.236/trunk@100318 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsFastLoadFile.cpp | 3 +++ mozilla/xpcom/io/nsFastLoadFile.h | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mozilla/xpcom/io/nsFastLoadFile.cpp b/mozilla/xpcom/io/nsFastLoadFile.cpp index aa0d03e2f5b..1ce49142d3c 100644 --- a/mozilla/xpcom/io/nsFastLoadFile.cpp +++ b/mozilla/xpcom/io/nsFastLoadFile.cpp @@ -230,6 +230,9 @@ static const char magic[] = MFL_FILE_MAGIC; // -------------------------- nsFastLoadFileReader -------------------------- +nsID nsFastLoadFileReader::nsFastLoadFooter::gDummyID; +nsFastLoadFileReader::nsObjectMapEntry nsFastLoadFileReader::nsFastLoadFooter::gDummySharpObjectEntry; + NS_IMPL_ISUPPORTS_INHERITED3(nsFastLoadFileReader, nsBinaryInputStream, nsIObjectInputStream, diff --git a/mozilla/xpcom/io/nsFastLoadFile.h b/mozilla/xpcom/io/nsFastLoadFile.h index ad001f0a6cb..a9f8a03eb23 100644 --- a/mozilla/xpcom/io/nsFastLoadFile.h +++ b/mozilla/xpcom/io/nsFastLoadFile.h @@ -299,22 +299,27 @@ class NS_COM nsFastLoadFileReader PL_DHashTableFinish(&mURIMap); } + // These can't be static within GetID and GetSharpObjectEntry or the + // toolchains on HP-UX 10.20's, RH 7.0, and Mac OS X all barf at link + // time ("common symbols not allowed with MY_DHLIB output format", to + // quote the OS X rev of gcc). + static nsID gDummyID; + static nsObjectMapEntry gDummySharpObjectEntry; + const nsID& GetID(NSFastLoadID aFastId) const { - static nsID dummy; PRUint32 index = aFastId - 1; NS_ASSERTION(index < mNumIDs, "aFastId out of range"); if (index >= mNumIDs) - return dummy; + return gDummyID; return mIDMap[index]; } nsObjectMapEntry& GetSharpObjectEntry(NSFastLoadOID aOID) const { - static nsObjectMapEntry dummy; PRUint32 index = MFL_OID_TO_SHARP_INDEX(aOID); NS_ASSERTION(index < mNumSharpObjects, "aOID out of range"); if (index >= mNumSharpObjects) - return dummy; + return gDummySharpObjectEntry; return mObjectMap[index]; }