From 5064536a78d99b6f7104d4a4555bddf68f99e20c Mon Sep 17 00:00:00 2001 From: "igor@mir2.org" Date: Thu, 23 Aug 2007 12:02:42 -0700 Subject: [PATCH] Bug 393364: Patch from Jason Orendorff to restore ability to compile SpiderMonkey with C++ compiler. r=me --- js/src/jsatom.c | 57 ++++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/js/src/jsatom.c b/js/src/jsatom.c index aaa25aaa2ad..547b26f0954 100644 --- a/js/src/jsatom.c +++ b/js/src/jsatom.c @@ -241,8 +241,39 @@ JS_STATIC_ASSERT(ATOM_ENTRY_FLAG_MASK < JSVAL_ALIGN); #define CLEAR_ATOM_ENTRY_FLAGS(entry, flags) \ ((void)((entry)->keyAndFlags &= ~(jsuword)(flags))) -static const JSDHashTableOps DoubleHashOps; -static const JSDHashTableOps StringHashOps; +JS_STATIC_DLL_CALLBACK(JSDHashNumber) +HashDouble(JSDHashTable *table, const void *key); + +JS_STATIC_DLL_CALLBACK(JSBool) +MatchDouble(JSDHashTable *table, const JSDHashEntryHdr *hdr, const void *key); + +JS_STATIC_DLL_CALLBACK(JSDHashNumber) +HashString(JSDHashTable *table, const void *key); + +JS_STATIC_DLL_CALLBACK(JSBool) +MatchString(JSDHashTable *table, const JSDHashEntryHdr *hdr, const void *key); + +static const JSDHashTableOps DoubleHashOps = { + JS_DHashAllocTable, + JS_DHashFreeTable, + HashDouble, + MatchDouble, + JS_DHashMoveEntryStub, + JS_DHashClearEntryStub, + JS_DHashFinalizeStub, + NULL +}; + +static const JSDHashTableOps StringHashOps = { + JS_DHashAllocTable, + JS_DHashFreeTable, + HashString, + MatchString, + JS_DHashMoveEntryStub, + JS_DHashClearEntryStub, + JS_DHashFinalizeStub, + NULL +}; #define IS_DOUBLE_TABLE(table) ((table)->ops == &DoubleHashOps) #define IS_STRING_TABLE(table) ((table)->ops == &StringHashOps) @@ -314,28 +345,6 @@ MatchString(JSDHashTable *table, const JSDHashEntryHdr *hdr, const void *key) return js_EqualStrings((JSString *)ATOM_ENTRY_KEY(entry), (JSString *)key); } -static const JSDHashTableOps DoubleHashOps = { - JS_DHashAllocTable, - JS_DHashFreeTable, - HashDouble, - MatchDouble, - JS_DHashMoveEntryStub, - JS_DHashClearEntryStub, - JS_DHashFinalizeStub, - NULL -}; - -static const JSDHashTableOps StringHashOps = { - JS_DHashAllocTable, - JS_DHashFreeTable, - HashString, - MatchString, - JS_DHashMoveEntryStub, - JS_DHashClearEntryStub, - JS_DHashFinalizeStub, - NULL -}; - /* * For a browser build from 2007-08-09 after the browser starts up there are * just 55 double atoms, but over 15000 string atoms. Not to penalize more