From 5f939c7a00b50db08cf804e28027a0b09be0aba5 Mon Sep 17 00:00:00 2001 From: Andew Paprocki Date: Tue, 22 Mar 2011 17:19:09 -0400 Subject: [PATCH] Bug 587103. Properly scope external calls in templated functions to fix compilation with some compilers. r=mrbkap --- js/src/jsclone.cpp | 4 ++-- js/src/jsgc.cpp | 4 ++-- js/src/jsgcinlines.h | 6 +++--- js/src/jsiter.cpp | 2 +- js/src/jstypedarray.cpp | 8 ++++---- js/src/v8-dtoa/checks.h | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/js/src/jsclone.cpp b/js/src/jsclone.cpp index c1d1f7e70db..5f8bb4d0b08 100644 --- a/js/src/jsclone.cpp +++ b/js/src/jsclone.cpp @@ -216,7 +216,7 @@ SCInput::readArray(T *p, size_t nelems) const T *q = (const T *) point; const T *qend = q + nelems; while (q != qend) - *p++ = SwapBytes(*q++); + *p++ = ::SwapBytes(*q++); } point += nwords; return true; @@ -325,7 +325,7 @@ SCOutput::writeArray(const T *p, size_t nelems) } else { const T *pend = p + nelems; while (p != pend) - *q++ = SwapBytes(*p++); + *q++ = ::SwapBytes(*p++); } return true; } diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 2457e93822c..3ff7bcfe20c 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -221,7 +221,7 @@ Arena::mark(T *thing, JSTracer *trc) JS_ASSERT(sizeof(T) == aheader.thingSize); JS_SET_TRACING_NAME(trc, "machine stack"); - Mark(trc, alignedThing); + js::gc::Mark(trc, alignedThing); #ifdef JS_DUMP_CONSERVATIVE_GC_ROOTS if (alignedThing != thing) @@ -1352,7 +1352,7 @@ Arena::markDelayedChildren(JSTracer *trc) JS_ASSERT(thing == getAlignedThing(thing)); while (thing <= thingsEnd) { if (thing->asCell()->isMarked()) - MarkChildren(trc, thing); + js::gc::MarkChildren(trc, thing); thing++; } diff --git a/js/src/jsgcinlines.h b/js/src/jsgcinlines.h index c392abf53db..08ef64ef190 100644 --- a/js/src/jsgcinlines.h +++ b/js/src/jsgcinlines.h @@ -202,7 +202,7 @@ static JS_ALWAYS_INLINE void Mark(JSTracer *trc, T *thing) { JS_ASSERT(thing); - JS_ASSERT(JS_IS_VALID_TRACE_KIND(GetGCThingTraceKind(thing))); + JS_ASSERT(JS_IS_VALID_TRACE_KIND(js::gc::GetGCThingTraceKind(thing))); JS_ASSERT(trc->debugPrinter || trc->debugPrintArg); /* Per-Compartment GC only with GCMarker and no custom JSTracer */ @@ -214,12 +214,12 @@ Mark(JSTracer *trc, T *thing) goto out; if (!IS_GC_MARKING_TRACER(trc)) { - uint32 kind = GetGCThingTraceKind(thing); + uint32 kind = js::gc::GetGCThingTraceKind(thing); trc->callback(trc, thing, kind); goto out; } - TypedMarker(trc, thing); + js::gc::TypedMarker(trc, thing); out: #ifdef DEBUG diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp index dd5313232c2..cfee6d1419b 100644 --- a/js/src/jsiter.cpp +++ b/js/src/jsiter.cpp @@ -226,7 +226,7 @@ EnumerateNativeProperties(JSContext *cx, JSObject *obj, JSObject *pobj, uintN fl } } - Reverse(props->begin() + initialLength, props->end()); + ::Reverse(props->begin() + initialLength, props->end()); return true; } diff --git a/js/src/jstypedarray.cpp b/js/src/jstypedarray.cpp index e0ae0e7b076..525394546a3 100644 --- a/js/src/jstypedarray.cpp +++ b/js/src/jstypedarray.cpp @@ -681,13 +681,13 @@ class TypedArrayTemplate case JSENUMERATE_INIT_ALL: statep->setBoolean(true); if (idp) - *idp = INT_TO_JSID(tarray->length + 1); + *idp = ::INT_TO_JSID(tarray->length + 1); break; case JSENUMERATE_INIT: statep->setInt32(0); if (idp) - *idp = INT_TO_JSID(tarray->length); + *idp = ::INT_TO_JSID(tarray->length); break; case JSENUMERATE_NEXT: @@ -697,7 +697,7 @@ class TypedArrayTemplate } else { uint32 index = statep->toInt32(); if (index < uint32(tarray->length)) { - *idp = INT_TO_JSID(index); + *idp = ::INT_TO_JSID(index); statep->setInt32(index + 1); } else { JS_ASSERT(index == tarray->length); @@ -1164,7 +1164,7 @@ class TypedArrayTemplate Value v; for (uintN i = 0; i < len; ++i) { - if (!ar->getProperty(cx, INT_TO_JSID(i), &v)) + if (!ar->getProperty(cx, ::INT_TO_JSID(i), &v)) return false; *dest++ = nativeFromValue(cx, v); } diff --git a/js/src/v8-dtoa/checks.h b/js/src/v8-dtoa/checks.h index 6119726c0f7..59c0e14265d 100644 --- a/js/src/v8-dtoa/checks.h +++ b/js/src/v8-dtoa/checks.h @@ -62,7 +62,7 @@ static inline void CheckHelper(const char* file, // The CHECK macro checks that the given condition is true; if not, it // prints a message to stderr and aborts. -#define CHECK(condition) CheckHelper(__FILE__, __LINE__, #condition, condition) +#define CHECK(condition) ::CheckHelper(__FILE__, __LINE__, #condition, condition) // Helper function used by the CHECK_EQ function when given int