Commit 3bfb61b0 authored by mjs's avatar mjs
Browse files

JavaScriptCore:

        Reviewed by Darin.
        
        - Set up new prototype macros and avoid using #if without defined() in JSC
        
        Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
        are defined, and to separate core OS-level dependencies from operating environment
        dependencies so you can, e.g., build KDE on Mac or Windows.

        * kxmlcore/Platform.h: Added.

        - deploy them everywhere in JavaScriptCore
        
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * bindings/jni/jni_utility.cpp:
        (KJS::Bindings::convertValueToJValue):
        * bindings/objc/WebScriptObject.mm:
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::end):
        * bindings/softlinking.h:
        * bindings/testbindings.mm:
        (main):
        * kjs/JSLock.cpp:
        * kjs/collector.cpp:
        (KJS::Collector::markCurrentThreadConservatively):
        (KJS::Collector::markOtherThreadConservatively):
        (KJ...
parent e1e53396
2006-03-01 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- Set up new prototype macros and avoid using #if without defined() in JSC
Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
are defined, and to separate core OS-level dependencies from operating environment
dependencies so you can, e.g., build KDE on Mac or Windows.
* kxmlcore/Platform.h: Added.
- deploy them everywhere in JavaScriptCore
* JavaScriptCore.xcodeproj/project.pbxproj:
* bindings/jni/jni_utility.cpp:
(KJS::Bindings::convertValueToJValue):
* bindings/objc/WebScriptObject.mm:
* bindings/objc/objc_instance.mm:
(ObjcInstance::end):
* bindings/softlinking.h:
* bindings/testbindings.mm:
(main):
* kjs/JSLock.cpp:
* kjs/collector.cpp:
(KJS::Collector::markCurrentThreadConservatively):
(KJS::Collector::markOtherThreadConservatively):
(KJS::Collector::markStackObjectsConservatively):
* kjs/config.h:
* kjs/date_object.cpp:
(gmtoffset):
(KJS::formatTime):
(KJS::DateProtoFunc::callAsFunction):
(KJS::DateObjectImp::construct):
(KJS::makeTime):
* kjs/dtoa.cpp:
* kjs/fpconst.cpp:
(KJS::sizeof):
(KJS::):
* kjs/grammar.y:
* kjs/identifier.cpp:
* kjs/internal.cpp:
* kjs/interpreter.cpp:
(KJS::Interpreter::evaluate):
(KJS::Interpreter::createLanguageInstanceForValue):
* kjs/interpreter.h:
* kjs/lookup.cpp:
* kjs/lookup.h:
* kjs/math_object.cpp:
* kjs/object.cpp:
* kjs/object.h:
* kjs/operations.cpp:
(KJS::isNaN):
(KJS::isInf):
(KJS::isPosInf):
(KJS::isNegInf):
* kjs/operations.h:
* kjs/regexp.cpp:
(KJS::RegExp::RegExp):
(KJS::RegExp::~RegExp):
(KJS::RegExp::match):
* kjs/regexp.h:
* kjs/testkjs.cpp:
(StopWatch::start):
(StopWatch::stop):
(StopWatch::getElapsedMS):
* kjs/ustring.cpp:
* kjs/ustring.h:
* kxmlcore/AlwaysInline.h:
* kxmlcore/Assertions.cpp:
* kxmlcore/Assertions.h:
* kxmlcore/FastMalloc.cpp:
(KXMLCore::):
* kxmlcore/FastMalloc.h:
* kxmlcore/FastMallocInternal.h:
* kxmlcore/HashTable.h:
* kxmlcore/TCPageMap.h:
* kxmlcore/TCSpinLock.h:
(TCMalloc_SpinLock::Lock):
(TCMalloc_SpinLock::Unlock):
(TCMalloc_SlowLock):
* kxmlcore/TCSystemAlloc.cpp:
(TCMalloc_SystemAlloc):
* os-win32/stdint.h:
2006-02-28 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin.
......
......@@ -43,6 +43,7 @@
6592C318098B7DE10003D4F6 /* Vector.h in Headers */ = {isa = PBXBuildFile; fileRef = 6592C316098B7DE10003D4F6 /* Vector.h */; settings = {ATTRIBUTES = (Private, ); }; };
6592C319098B7DE10003D4F6 /* VectorTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 6592C317098B7DE10003D4F6 /* VectorTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
65C647B4093EF8D60022C380 /* RefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C647B3093EF8D60022C380 /* RefPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
65D6D87F09B5A32E0002E4D7 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 65D6D87E09B5A32E0002E4D7 /* Platform.h */; settings = {ATTRIBUTES = (Private, ); }; };
65D7D19C08F10B5B0015ABD8 /* FastMallocInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 65D7D19B08F10B5B0015ABD8 /* FastMallocInternal.h */; };
65DFC93008EA173A00F7300B /* HashFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92A08EA173A00F7300B /* HashFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; };
65DFC93108EA173A00F7300B /* HashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DFC92B08EA173A00F7300B /* HashMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -353,6 +354,7 @@
6592C317098B7DE10003D4F6 /* VectorTraits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VectorTraits.h; sourceTree = "<group>"; };
65C02FBB0637462A003E7EE6 /* protect.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = protect.h; sourceTree = "<group>"; tabWidth = 8; };
65C647B3093EF8D60022C380 /* RefPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = RefPtr.h; sourceTree = "<group>"; tabWidth = 8; };
65D6D87E09B5A32E0002E4D7 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Platform.h; sourceTree = "<group>"; };
65D7D19B08F10B5B0015ABD8 /* FastMallocInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = FastMallocInternal.h; sourceTree = "<group>"; tabWidth = 8; };
65DFC92A08EA173A00F7300B /* HashFunctions.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HashFunctions.h; sourceTree = "<group>"; tabWidth = 8; };
65DFC92B08EA173A00F7300B /* HashMap.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HashMap.h; sourceTree = "<group>"; tabWidth = 8; };
......@@ -596,6 +598,7 @@
65162EF108E6A21C007556CD /* kxmlcore */ = {
isa = PBXGroup;
children = (
65D6D87E09B5A32E0002E4D7 /* Platform.h */,
93AA4F770957251F0084B3A7 /* AlwaysInline.h */,
65E217B708E7EECC0023E5F6 /* Assertions.h */,
65E217B808E7EECC0023E5F6 /* Assertions.cpp */,
......@@ -860,6 +863,7 @@
1483B58A099BC1950016E4F0 /* JSImmediate.h in Headers */,
14ABB36F099C076400E2A24F /* value.h in Headers */,
14ABB455099C2A0F00E2A24F /* JSType.h in Headers */,
65D6D87F09B5A32E0002E4D7 /* Platform.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -737,7 +737,7 @@ jvalue convertValueToJValue (ExecState *exec, JSValue *value, JNIType _JNIType,
// Now convert value to a string if the target type is a java.lang.string, and we're not
// converting from a Null.
if (result.l == 0 && strcmp(javaClassName, "java.lang.String") == 0) {
#if CONVERT_NULL_TO_EMPTY_STRING
#ifdef CONVERT_NULL_TO_EMPTY_STRING
if (value->isNull()) {
JNIEnv *env = getJNIEnv();
jchar buf[2];
......
......@@ -38,14 +38,6 @@
#import <kxmlcore/UnusedParam.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
@interface NSObject (WebExtras)
- (void)finalize;
@end
#endif
using namespace KJS;
using namespace KJS::Bindings;
......
......@@ -103,11 +103,7 @@ void ObjcInstance::end()
_beginCount--;
assert (_beginCount >= 0);
if (_beginCount == 0) {
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
[_pool release];
#else
[_pool drain];
#endif
}
_pool = 0;
}
......
......@@ -25,7 +25,7 @@
#include <JavaVM/jni.h>
#if __cplusplus
#ifdef __cplusplus
extern "C"
#endif
jint KJS_GetCreatedJavaVMs(JavaVM **vmBuf, jsize bufLen, jsize *nVMs);
......@@ -281,12 +281,7 @@ int main(int argc, char **argv)
}
[myInterface release];
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
[pool release];
#else
[pool drain];
#endif
} // end block, so that Interpreter and global get deleted
return ret ? 0 : 3;
......
......@@ -27,7 +27,7 @@
namespace KJS {
#if KJS_MULTIPLE_THREADS
#if USE(MULTIPLE_THREADS)
static pthread_once_t interpreterLockOnce = PTHREAD_ONCE_INIT;
static pthread_mutex_t interpreterLock;
......
......@@ -32,29 +32,29 @@
#include <setjmp.h>
#include <algorithm>
#if __APPLE__
#if PLATFORM(DARWIN)
#include <pthread.h>
#include <mach/mach_port.h>
#include <mach/task.h>
#include <mach/thread_act.h>
#elif WIN32
#elif PLATFORM(WIN_OS)
#include <windows.h>
#else
#elif PLATFORM(UNIX)
#include <pthread.h>
#ifdef HAVE_PTHREAD_NP_H
#if HAVE(PTHREAD_NP_H)
#include <pthread_np.h>
#endif
#endif
#define DEBUG_COLLECTOR 0
using std::max;
namespace KJS {
......@@ -191,7 +191,7 @@ allocateNewBlock:
return newCell;
}
#if KJS_MULTIPLE_THREADS
#if USE(MULTIPLE_THREADS)
struct Collector::Thread {
Thread(pthread_t pthread, mach_port_t mthread) : posixThread(pthread), machThread(mthread) {}
......@@ -300,23 +300,23 @@ void Collector::markCurrentThreadConservatively()
jmp_buf registers;
setjmp(registers);
#if __APPLE__
#if PLATFORM(DARWIN)
pthread_t thread = pthread_self();
void *stackBase = pthread_get_stackaddr_np(thread);
#elif WIN32
#elif PLATFORM(WIN_OS) && PLATFORM(X86) && COMPILER(MSVC)
NT_TIB *pTib;
__asm {
MOV EAX, FS:[18h]
MOV pTib, EAX
}
void *stackBase = (void *)pTib->StackBase;
#else
#elif PLATFORM(UNIX)
static void *stackBase = 0;
static pthread_t stackThread;
pthread_t thread = pthread_self();
if (stackBase == 0 || thread != stackThread) {
pthread_attr_t sattr;
#ifdef HAVE_PTHREAD_NP_H
#if HAVE(PTHREAD_NP_H)
// e.g. on FreeBSD 5.4, neundorf@kde.org
pthread_attr_get_np(thread, &sattr);
#else
......@@ -329,6 +329,8 @@ void Collector::markCurrentThreadConservatively()
assert(stackBase);
stackThread = thread;
}
#else
#error Need a way to get the stack base on this platform
#endif
int dummy;
......@@ -337,7 +339,7 @@ void Collector::markCurrentThreadConservatively()
markStackObjectsConservatively(stackPointer, stackBase);
}
#if KJS_MULTIPLE_THREADS
#if USE(MULTIPLE_THREADS)
typedef unsigned long usword_t; // word size, assumed to be either 32 or 64 bit
......@@ -345,15 +347,15 @@ void Collector::markOtherThreadConservatively(Thread *thread)
{
thread_suspend(thread->machThread);
#if KJS_CPU_X86
#if PLATFORM(X86)
i386_thread_state_t regs;
unsigned user_count = sizeof(regs)/sizeof(int);
thread_state_flavor_t flavor = i386_THREAD_STATE;
#elif KJS_CPU_PPC
#elif PLATFORM(PPC)
ppc_thread_state_t regs;
unsigned user_count = PPC_THREAD_STATE_COUNT;
thread_state_flavor_t flavor = PPC_THREAD_STATE;
#elif KJS_CPU_PPC64
#elif PLATFORM(PPC64)
ppc_thread_state64_t regs;
unsigned user_count = PPC_THREAD_STATE64_COUNT;
thread_state_flavor_t flavor = PPC_THREAD_STATE64;
......@@ -367,9 +369,9 @@ void Collector::markOtherThreadConservatively(Thread *thread)
markStackObjectsConservatively((void *)&regs, (void *)((char *)&regs + (user_count * sizeof(usword_t))));
// scan the stack
#if KJS_CPU_X86
#if PLATFORM(X86)
markStackObjectsConservatively((void *)regs.esp, pthread_get_stackaddr_np(thread->posixThread));
#elif KJS_CPU_PPC || KJS_CPU_PPC64
#elif PLATFORM(PPC) || PLATFORM(PPC64)
markStackObjectsConservatively((void *)regs.r1, pthread_get_stackaddr_np(thread->posixThread));
#else
#error Unknown Architecture
......@@ -384,7 +386,7 @@ void Collector::markStackObjectsConservatively()
{
markCurrentThreadConservatively();
#if KJS_MULTIPLE_THREADS
#if USE(MULTIPLE_THREADS)
for (Thread *thread = registeredThreads; thread != NULL; thread = thread->next) {
if (thread->posixThread != pthread_self()) {
markOtherThreadConservatively(thread);
......
#if __APPLE__
#include <kxmlcore/Platform.h>
#if PLATFORM(DARWIN)
#define HAVE_ERRNO_H 1
#define HAVE_FUNC_ISINF 1
......@@ -10,17 +12,20 @@
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TIMEB_H 1
#define KJS_MULTIPLE_THREADS 1
#elif WIN32
#elif PLATFORM(WIN_OS)
#define HAVE_FLOAT_H 1
#define HAVE_FUNC__FINITE 1
#define HAVE_SYS_TIMEB_H 1
#define USE_SYSTEM_MALLOC 1
#else
// FIXME: is this actually used or do other platforms generate their
// own config.h?
#define HAVE_ERRNO_H 1
#define HAVE_FUNC_ISINF 1
#define HAVE_FUNC_ISNAN 1
......@@ -32,22 +37,13 @@
#endif
#define HAVE_FUNC_STRTOLL 1
#define HAVE_ICU 1
#define HAVE_PCREPOSIX 1
// FIXME: if all platforms have these, do they really need #defines?
#define HAVE_STDINT_H 1
#define HAVE_STRING_H 1
#if __ppc__ || __PPC__ || __powerpc__
#define KJS_CPU_PPC 1
#define WORDS_BIGENDIAN 1
#elif __ppc64__ || __PPC64__
#define KJS_CPU_PPC64 1
#define WORDS_BIGENDIAN 1
#elif __i386__
#define KJS_CPU_X86 1
#endif
#define KXC_CHANGES 1
#ifdef __cplusplus
......
......@@ -22,19 +22,19 @@
#include "config.h"
#include "date_object.h"
#if HAVE_ERRNO_H
#if HAVE(ERRNO_H)
#include <errno.h>
#endif
#if HAVE_SYS_PARAM_H
#if HAVE(SYS_PARAM_H)
#include <sys/param.h>
#endif
#if HAVE_SYS_TIME_H
#if HAVE(SYS_TIME_H)
#include <sys/time.h>
#endif
#if HAVE_SYS_TIMEB_H
#if HAVE(SYS_TIMEB_H)
#include <sys/timeb.h>
#endif
......@@ -51,11 +51,11 @@
#include "error_object.h"
#include "operations.h"
#if __APPLE__
#if PLATFORM(MAC)
#include <CoreFoundation/CoreFoundation.h>
#endif
#if WIN32
#if PLATFORM(WIN_OS)
#define copysign(x, y) _copysign(x, y)
#define isfinite(x) _finite(x)
#define strncasecmp(x, y, z) strnicmp(x, y, z)
......@@ -64,7 +64,7 @@
inline int gmtoffset(const tm& t)
{
#if WIN32
#if PLATFORM(WIN_OS)
// Time is supposed to be in the current timezone.
// FIXME: Use undocumented _dstbias?
return -(_timezone / 60 - (t.tm_isdst > 0 ? 60 : 0 )) * 60;
......@@ -141,7 +141,7 @@ static double parseDate(const UString &);
static double timeClip(double);
static void millisecondsToTM(double milli, bool utc, tm *t);
#if __APPLE__
#if PLATFORM(MAC)
static CFDateFormatterStyle styleFromArgString(const UString& string, CFDateFormatterStyle defaultStyle)
{
......@@ -206,7 +206,7 @@ static UString formatLocaleDate(ExecState *exec, double time, bool includeDate,
return UString(buffer, length);
}
#endif // __APPLE__
#endif // PLATFORM(MAC)
static UString formatDate(const tm &t)
{
......@@ -230,7 +230,8 @@ static UString formatTime(const tm &t, bool utc)
{
char buffer[100];
if (utc) {
#if !WIN32
// FIXME: why not on windows?
#if !PLATFORM(WIN_OS)
ASSERT(t.tm_gmtoff == 0);
#endif
snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d GMT", t.tm_hour, t.tm_min, t.tm_sec);
......@@ -553,7 +554,7 @@ JSValue *DateProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const
JSValue *result = 0;
UString s;
#if !__APPLE__
#if !PLATFORM(DARWIN)
const int bufsize=100;
char timebuffer[bufsize];
CString oldlocale = setlocale(LC_TIME, 0);
......@@ -609,7 +610,7 @@ JSValue *DateProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const
case ToUTCString:
return jsString(formatDateUTCVariant(t) + " " + formatTime(t, utc));
break;
#if __APPLE__
#if PLATFORM(MAC)
case ToLocaleString:
return jsString(formatLocaleDate(exec, secs, true, true, args));
break;
......@@ -734,19 +735,19 @@ JSObject *DateObjectImp::construct(ExecState *exec, const List &args)
double value;
if (numArgs == 0) { // new Date() ECMA 15.9.3.3
#if !WIN32
struct timeval tv;
gettimeofday(&tv, 0);
double utc = floor(tv.tv_sec * msPerSecond + tv.tv_usec / 1000);
#else
# if __BORLANDC__
#if PLATFORM(WIN_OS)
#if COMPILER(BORLAND)
struct timeb timebuffer;
ftime(&timebuffer);
# else
#else
struct _timeb timebuffer;
_ftime(&timebuffer);
# endif
#endif
double utc = timebuffer.time * msPerSecond + timebuffer.millitm;
#else
struct timeval tv;
gettimeofday(&tv, 0);
double utc = floor(tv.tv_sec * msPerSecond + tv.tv_usec / 1000);
#endif
value = utc;
} else if (numArgs == 1) {
......@@ -854,7 +855,7 @@ static inline double ymdhmsToSeconds(long year, int mon, int day, int hour, int
// We follow the recommendation of RFC 2822 to consider all
// obsolete time zones not listed here equivalent to "-0000".
static const struct KnownZone {
#if !WIN32
#if !PLATFORM(WIN_OS)
const
#endif
char tzName[4];
......@@ -877,20 +878,20 @@ static double makeTime(tm *t, double ms, bool utc)
int utcOffset;
if (utc) {
time_t zero = 0;
#if !WIN32
tm t3;
localtime_r(&zero, &t3);
utcOffset = t3.tm_gmtoff;
t->tm_isdst = t3.tm_isdst;
#else
#if PLATFORM(WIN_OS)
// FIXME: not thread safe
(void)localtime(&zero);
# if __BORLANDC__ || __CYGWIN__
#if COMPILER(BORLAND) || COMPILER(CYGWIN)
utcOffset = - _timezone;
# else
#else
utcOffset = - timezone;
# endif
#endif
t->tm_isdst = 0;
#else
tm t3;
localtime_r(&zero, &t3);
utcOffset = t3.tm_gmtoff;
t->tm_isdst = t3.tm_isdst;
#endif
} else {
utcOffset = 0;
......
......@@ -172,7 +172,7 @@
#include "config.h"
#include "dtoa.h"
#ifdef WORDS_BIGENDIAN
#if PLATFORM(BIG_ENDIAN)
#define IEEE_MC68k
#else
#define IEEE_8087
......
......@@ -31,16 +31,37 @@ namespace KJS {
// characters don't necessarily need the same alignment doubles do, but for now it seems to work.
// It would be good to figure out a 100% clean way that still avoids code that runs at init time.
#if __APPLE__
#if PLATFORM(DARWIN)
#ifdef WORDS_BIGENDIAN
extern const unsigned char NaN[sizeof(double)] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 };
extern const unsigned char Inf[sizeof(double)] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 };
#if PLATFORM(BIG_ENDIAN)
extern const unsigned char NaN[sizeof(double)] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 };
extern const unsigned char Inf[sizeof(double)] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 };
#elif PLATFORM(MIDDLE_ENDIAN)
extern const unsigned char NaN[] = { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 };
extern const unsigned char Inf[] = { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 };
#else
extern const unsigned char NaN[sizeof(double)] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f };
extern const unsigned char Inf[sizeof(double)] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
#endif
extern const unsigned char NaN[sizeof(double)] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f };
extern const unsigned char Inf[sizeof(double)] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
#endif // PLATFORM(MIDDLE_ENDIAN)
#else // !PLATFORM(DARWIN)
#include "value.h"
#if PLATFORM(BIG_ENDIAN)
const unsigned char NaN_Bytes[] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 };
const unsigned char Inf_Bytes[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 };
#elif PLATFORM(MIDDLE_ENDIAN)
const unsigned char NaN_Bytes[] = { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 };
const unsigned char Inf_Bytes[] = { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 };
#else
const unsigned char NaN_Bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f };
const unsigned char Inf_Bytes[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f };
#endif
const double NaN = *(const double*) NaN_Bytes;
const double Inf = *(const double*) Inf_Bytes;
#endif // !PLATFORM(DARWIN)
}
} // namespace KJS
......@@ -3,6 +3,7 @@
/*
* This file is part of the KDE libraries
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2006 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -37,7 +38,8 @@
/* default values for bison */
#define YYDEBUG 0
#if !__APPLE__ /* work around the fact that YYERROR_VERBOSE causes a compiler warning in bison code */
#if !PLATFORM(DARWIN)
// avoid triggering warnings in older bison
#define YYERROR_VERBOSE
#endif
......
......@@ -25,7 +25,7 @@
// portable, and it would be good to figure out a 100% clean way that still avoids code that
// runs at init time.
#if !defined(WIN32) // can't get this to compile on Visual C++ yet