+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.
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, ); }; };
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; };
65162EF108E6A21C007556CD /* kxmlcore */ = {
isa = PBXGroup;
children = (
+ 65D6D87E09B5A32E0002E4D7 /* Platform.h */,
93AA4F770957251F0084B3A7 /* AlwaysInline.h */,
65E217B708E7EECC0023E5F6 /* Assertions.h */,
65E217B808E7EECC0023E5F6 /* Assertions.cpp */,
1483B58A099BC1950016E4F0 /* JSImmediate.h in Headers */,
14ABB36F099C076400E2A24F /* value.h in Headers */,
14ABB455099C2A0F00E2A24F /* JSType.h in Headers */,
+ 65D6D87F09B5A32E0002E4D7 /* Platform.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
// 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];
#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;
_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;
}
#include <JavaVM/jni.h>
-#if __cplusplus
+#ifdef __cplusplus
extern "C"
#endif
jint KJS_GetCreatedJavaVMs(JavaVM **vmBuf, jsize bufLen, jsize *nVMs);
}
[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;
namespace KJS {
-#if KJS_MULTIPLE_THREADS
+#if USE(MULTIPLE_THREADS)
static pthread_once_t interpreterLockOnce = PTHREAD_ONCE_INIT;
static pthread_mutex_t interpreterLock;
#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 {
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) {}
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
assert(stackBase);
stackThread = thread;
}
+#else
+#error Need a way to get the stack base on this platform
#endif
int dummy;
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
{
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;
markStackObjectsConservatively((void *)®s, (void *)((char *)®s + (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
{
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
#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
#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
#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
#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)
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;
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)
{
return UString(buffer, length);
}
-#endif // __APPLE__
+#endif // PLATFORM(MAC)
static UString formatDate(const tm &t)
{
{
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);
JSValue *result = 0;
UString s;
-#if !__APPLE__
+#if !PLATFORM(DARWIN)
const int bufsize=100;
char timebuffer[bufsize];
CString oldlocale = setlocale(LC_TIME, 0);
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;
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) {
// 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];
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;
#include "config.h"
#include "dtoa.h"
-#ifdef WORDS_BIGENDIAN
+#if PLATFORM(BIG_ENDIAN)
#define IEEE_MC68k
#else
#define IEEE_8087
// 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
/*
* 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
/* 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
// 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
+#if !PLATFORM(WIN_OS) // can't get this to compile on Visual C++ yet
#define AVOID_STATIC_CONSTRUCTORS 1
#endif
namespace KJS {
-#if !__APPLE__
-
-#ifdef WORDS_BIGENDIAN
- 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 defined(arm)
- 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
-
-#if WIN32
+#if PLATFORM(WIN_OS)
#define copysign _copysign
#endif
#include "nodes.h"
#include "object.h"
#include "operations.h"
-#if __APPLE__
-#include "runtime.h"
-#endif
#include "types.h"
#include "value.h"
+#if PLATFORM(MAC)
+#include "runtime.h"
+#endif
+
namespace KJS {
// ------------------------------ Context --------------------------------------
CString f = sourceURL.UTF8String();
CString message = comp.value()->toObject(exec)->toString(exec).UTF8String();
int line = comp.value()->toObject(exec)->get(exec, "line")->toUInt32(exec);
-#ifdef WIN32
+#if PLATFORM(WIN_OS)
printf("%s line %d: %s\n", f.c_str(), line, message.c_str());
#else
printf("[%d] %s line %d: %s\n", getpid(), f.c_str(), line, message.c_str());
printExceptions = print;
}
-#if __APPLE__
+// bindings are OS X WebKit-only for now
+#if PLATFORM(MAC)
void *Interpreter::createLanguageInstanceForValue(ExecState *exec, int language, JSObject *value, const Bindings::RootObject *origin, const Bindings::RootObject *current)
{
return Bindings::Instance::createLanguageInstanceForValue (exec, (Bindings::Instance::BindingLanguage)language, value, origin, current);
}
-
#endif
void Interpreter::saveBuiltins (SavedBuiltins &builtins) const
*/
virtual bool isSafeScript(const Interpreter*) { return true; }
-#if __APPLE__
+#if PLATFORM(MAC)
virtual void *createLanguageInstanceForValue(ExecState*, int language, JSObject* value, const Bindings::RootObject* origin, const Bindings::RootObject* current);
#endif
#include "lookup.h"
-#ifdef HAVE_CONFIG_H
-#endif
-
using namespace KJS;
static inline bool keysMatch(const UChar *c, unsigned len, const char *s)
*/
// Work around a bug in GCC 4.1
-#if !__GNUC__
+#if !COMPILER(GCC)
#define KJS_GCC_ROOT_NS_HACK ::
#else
#define KJS_GCC_ROOT_NS_HACK
#include "math_object.lut.h"
-#if WIN32
+#if PLATFORM(WIN_OS)
#include <float.h>
static int signbit(double d)
#include "error_object.h"
#include "nodes.h"
-#ifndef NDEBUG
-//#define JAVASCRIPT_CALL_TRACING 1
-#endif
+#define JAVASCRIPT_CALL_TRACING 0
#if JAVASCRIPT_CALL_TRACING
static bool _traceJavaScript = false;
// maximum global call stack size. Protects against accidental or
// malicious infinite recursions. Define to -1 if you want no limit.
-#if __APPLE__
+#if PLATFORM(DARWIN)
// Given OS X stack sizes we run out of stack at about 350 levels.
// If we improve our stack usage, we can bump this number.
#define KJS_MAX_STACK 100
#include <stdio.h>
#include <stdlib.h>
-#ifndef HAVE_FUNC_ISINF
-#ifdef HAVE_IEEEFP_H
+#if HAVE(FUNC_ISINF) && HAVE(IEEEFP_H)
#include <ieeefp.h>
#endif
-#endif /* HAVE_FUNC_ISINF */
-#if HAVE_FLOAT_H
+#if HAVE(FLOAT_H)
#include <float.h>
#endif
namespace KJS {
-#if !__APPLE__
+#if !PLATFORM(DARWIN)
+ // FIXME: should probably be inlined on other platforms too, and controlled exclusively
+ // by HAVE macros
+
bool isNaN(double d)
{
-#ifdef HAVE_FUNC_ISNAN
+#if HAVE(FUNC_ISNAN)
return isnan(d);
-#elif defined HAVE_FLOAT_H
+#elif HAVE(FLOAT_H)
return _isnan(d) != 0;
#else
return !(d == d);
bool isInf(double d)
{
-#if WIN32
+ // FIXME: should be HAVE(_FPCLASS)
+#if PLATFORM(WIN_OS)
int fpClass = _fpclass(d);
return _FPCLASS_PINF == fpClass || _FPCLASS_NINF == fpClass;
-#elif defined(HAVE_FUNC_ISINF)
+#elif HAVE(FUNC_ISINF)
return isinf(d);
-#elif HAVE_FUNC_FINITE
+#elif HAVE(FUNC_FINITE)
return finite(d) == 0 && d == d;
-#elif HAVE_FUNC__FINITE
+#elif HAVE(FUNC__FINITE)
return _finite(d) == 0 && d == d;
#else
return false;
bool isPosInf(double d)
{
-#if WIN32
+ // FIXME: should be HAVE(_FPCLASS)
+#if PLATFORM(WIN_OS)
return _FPCLASS_PINF == _fpclass(d);
-#elif defined(HAVE_FUNC_ISINF)
+#elif HAVE(FUNC_ISINF)
return (isinf(d) == 1);
-#elif HAVE_FUNC_FINITE
- return finite(d) == 0 && d == d; // ### can we distinguish between + and - ?
-#elif HAVE_FUNC__FINITE
- return _finite(d) == 0 && d == d; // ###
+#elif HAVE(FUNC_FINITE)
+ return !finite(d) && d == d; // ### can we distinguish between + and - ?
+#elif HAVE(FUNC__FINITE)
+ return !_finite(d) && d == d; // ###
#else
return false;
#endif
bool isNegInf(double d)
{
-#if WIN32
+ // FIXME: should be HAVE(_FPCLASS)
+#if PLATFORM(WIN_OS)
return _FPCLASS_NINF == _fpclass(d);
-#elif defined(HAVE_FUNC_ISINF)
+#elif HAVE(FUNC_ISINF)
return (isinf(d) == -1);
-#elif HAVE_FUNC_FINITE
+#elif HAVE(FUNC_FINITE)
return finite(d) == 0 && d == d; // ###
-#elif HAVE_FUNC__FINITE
+#elif HAVE(FUNC__FINITE)
return _finite(d) == 0 && d == d; // ###
#else
return false;
class ExecState;
class JSValue;
-#if __APPLE__
+#if PLATFORM(DARWIN)
inline bool isNaN(double d) { return isnan(d); }
inline bool isInf(double d) { return isinf(d); }
inline bool isPosInf(double d) { return isinf(d) && d > 0; }
inline bool isNegInf(double d) { return isinf(d) && d < 0; }
#else
- /**
- * @return True if d is not a number (platform support required).
- */
bool isNaN(double d);
- /**
- * @return True if d is infinite (platform support required).
- */
bool isInf(double d);
bool isPosInf(double d);
bool isNegInf(double d);
RegExp::RegExp(const UString &p, int flags)
: _flags(flags), _numSubPatterns(0)
{
-#ifdef HAVE_PCREPOSIX
+#if HAVE(PCREPOSIX)
int options = PCRE_UTF8;
// Note: the Global flag is already handled by RegExpProtoFunc::execute.
pcre_fullinfo(_regex, NULL, PCRE_INFO_CAPTURECOUNT, &_numSubPatterns);
#endif
-#else /* HAVE_PCREPOSIX */
+#else /* HAVE(PCREPOSIX) */
int regflags = 0;
#ifdef REG_EXTENDED
RegExp::~RegExp()
{
-#ifdef HAVE_PCREPOSIX
+#if HAVE(PCREPOSIX)
pcre_free(_regex);
#else
/* TODO: is this really okay after an error ? */
if (i > s.size() || s.isNull())
return UString::null();
-#ifdef HAVE_PCREPOSIX
+#if HAVE(PCREPOSIX)
if (!_regex)
return UString::null();
#include "config.h"
-#ifdef HAVE_PCREPOSIX
+#if HAVE(PCREPOSIX)
#include <pcre.h>
#else // POSIX regex - not so good...
extern "C" { // bug with some libc5 distributions
#include <regex.h>
}
-#endif //HAVE_PCREPOSIX
+#endif // HAVE(PCREPOSIX)
#include "ustring.h"
unsigned subPatterns() const { return _numSubPatterns; }
private:
-#ifdef HAVE_PCREPOSIX
+#if HAVE(PCREPOSIX)
pcre *_regex;
#else
regex_t _regex;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#if HAVE_SYS_TIME_H
+#if HAVE(SYS_TIME_H)
#include <sys/time.h>
#endif
long getElapsedMS(); // call stop() first
private:
-#if !WIN32
+#if !PLATFORM(WIN_OS)
// Windows does not have timeval, disabling this class for now (bug 7399)
timeval m_startTime;
timeval m_stopTime;
void StopWatch::start()
{
-#if !WIN32
+#if !PLATFORM(WIN_OS)
gettimeofday(&m_startTime, 0);
#endif
}
void StopWatch::stop()
{
-#if !WIN32
+#if !PLATFORM(WIN_OS)
gettimeofday(&m_stopTime, 0);
#endif
}
long StopWatch::getElapsedMS()
{
-#if !WIN32
+#if !PLATFORM(WIN_OS)
timeval elapsedTime;
timersub(&m_stopTime, &m_startTime, &elapsedTime);
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
-#ifdef HAVE_STRING_H
+#if HAVE(STRING_H)
#include <string.h>
#endif
-#ifdef HAVE_STRINGS_H
+#if HAVE(STRINGS_H)
#include <strings.h>
#endif
#include <kxmlcore/RefPtr.h>
#include <kxmlcore/PassRefPtr.h>
-#if __APPLE__
-#include <sys/types.h>
-#ifndef KWQ_UNSIGNED_TYPES_DEFINED
-#define KWQ_UNSIGNED_TYPES_DEFINED
-typedef unsigned char uchar;
-typedef unsigned long ulong;
-#endif
-#endif
-
#include <stdint.h>
/**
*/
#ifndef ALWAYS_INLINE
-#if defined(__GNUC__) && (__GNUC__ > 3)
+#if COMPILER(GCC)
#define ALWAYS_INLINE inline __attribute__ ((__always_inline__))
#else
#define ALWAYS_INLINE inline
#include "stdio.h"
#include "stdarg.h"
-#if __APPLE__
+#if PLATFORM(MAC)
#include <CoreFoundation/CFString.h>
#endif
static void vprintf_stderr_common(const char *format, va_list args)
{
-#if __APPLE__
+#if PLATFORM(MAC)
if (!strstr(format, "%@")) {
CFStringRef cfFormat = CFStringCreateWithCString(NULL, format, kCFStringEncodingUTF8);
CFStringRef str = CFStringCreateWithFormatAndArguments(NULL, NULL, cfFormat, args);
// For non-debug builds, everything is disabled by default.
// Defining any of the symbols explicitly prevents this from having any effect.
-#if !__APPLE__
-#define ASSERT_DISABLED 1 // FIXME: We have to undo all the assert macros, since they are currently in a .mm file and use obj-c.
-#else
#ifdef NDEBUG
#define ASSERTIONS_DISABLED_DEFAULT 1
#else
#define ASSERTIONS_DISABLED_DEFAULT 0
#endif
-#endif
#ifndef ASSERT_DISABLED
#define ASSERT_DISABLED ASSERTIONS_DISABLED_DEFAULT
#define LOG_DISABLED ASSERTIONS_DISABLED_DEFAULT
#endif
-#ifdef __GNUC__
+#if COMPILER(GCC)
#define KXMLCORE_PRETTY_FUNCTION __PRETTY_FUNCTION__
#else
#define KXMLCORE_PRETTY_FUNCTION __FUNCTION__
#ifndef NDEBUG
#define USE_SYSTEM_MALLOC 1
+#else
+#define USE_SYSTEM_MALLOC 0
#endif
#if USE_SYSTEM_MALLOC
return realloc(p, n);
}
-#if !WIN32
+#if PLATFORM(WIN_OS)
void fastMallocRegisterThread(pthread_t)
{
}
#else
-#if HAVE_STDINT_H
+#if HAVE(STDINT_H)
#include <stdint.h>
-#elif HAVE_INTTYPES_H
+#elif HAVE(INTTYPES_H)
#include <inttypes.h>
#else
#include <sys/types.h>
#endif
-#if defined HAVE_INTTYPES_H
+#if HAVE(INTTYPES_H)
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#define LLU PRIu64
static size_t class_to_pages[kNumClasses];
// Return floor(log2(n)) for n > 0.
-#if defined __i386__ && defined __GNUC__
+#if PLATFORM(X86) && COMPILER(GCC)
static inline int LgFloor(size_t n) {
// "ro" for the input spec means the input can come from either a
// register ("r") or offsetable memory ("o").
return result;
}
-#elif defined __ppc__ && defined __GNUC__
+#elif PLATFORM(PPC) && COMPILER(GCC)
static inline int LgFloor(size_t n) {
// "r" for the input spec means the input must come from a
// register ("r")
//-------------------------------------------------------------------
extern "C" {
-#if defined(__GNUC__) && defined(HAVE___ATTRIBUTE__)
+#if COMPILER(GCC) && HAVE(__ATTRIBUTE__)
// Potentially faster variants that use the gcc alias extension
#define ALIAS(x) __attribute__ ((weak, alias (x)))
void* __libc_malloc(size_t size) ALIAS("malloc");
using KXMLCore::fastRealloc;
using KXMLCore::fastFree;
-#if __GNUC__
-
-#if __APPLE__
+#if PLATFORM(GCC) && PLATFORM(DARWIN)
#define KXMLCORE_PRIVATE_INLINE __private_extern__ inline __attribute__((always_inline))
-#else
+#elif PLATFORM(GCC)
#define KXMLCORE_PRIVATE_INLINE inline __attribute__((always_inline))
-#endif
-
#else
#define KXMLCORE_PRIVATE_INLINE inline
#endif
KXMLCORE_PRIVATE_INLINE void* operator new[](size_t s) { return fastMalloc(s); }
KXMLCORE_PRIVATE_INLINE void operator delete[](void* p) { fastFree(p); }
-
#endif /* KXMLCORE_FAST_MALLOC_H */
#ifndef KXMLCORE_FAST_MALLOC_INTERNAL_H
#define KXMLCORE_FAST_MALLOC_INTERNAL_H
-#ifndef WIN32
+#if !PLATFORM(WIN_OS)
#include <pthread.h>
#define DUMP_HASHTABLE_STATS 0
#define CHECK_HASHTABLE_CONSISTENCY 0
-#if NDEBUG
+#ifdef NDEBUG
#define CHECK_HASHTABLE_ITERATORS 0
#else
#define CHECK_HASHTABLE_ITERATORS 1
using std::swap;
-#if !WIN32
+#if !COMPILER(MSVC)
// Visual C++ has a swap for pairs defined.
// swap pairs by component, in case of pair members that specialize swap
--- /dev/null
+// -*- mode: c++; c-basic-offset: 4 -*-
+/*
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef KXMLCORE_PLATFORM_H
+#define KXMLCORE_PLATFORM_H
+
+// PLATFORM handles OS, operating environment, graphics API, and CPU
+#define PLATFORM(FEATURE) (defined(KXMLCORE_PLATFORM_##FEATURE) && KXMLCORE_PLATFORM_##FEATURE)
+#define COMPILER(FEATURE) (defined(KXMLCORE_COMPILER_##FEATURE) && KXMLCORE_COMPILER_##FEATURE)
+#define HAVE(FEATURE) (defined(HAVE_##FEATURE) && HAVE_##FEATURE)
+#define USE(FEATURE) (defined(KXMLCORE_USE_##FEATURE) && KXMLCORE_USE_##FEATURE)
+
+// Operating systems - low-level dependencies
+
+// PLATFORM(DARWIN)
+// Operating system level dependencies for Mac OS X / Darwin that should
+// be used regardless of operating environment
+#ifdef __APPLE__
+#define KXMLCORE_PLATFORM_DARWIN 1
+#endif
+
+// PLATFORM(WIN_OS)
+// Operating system level dependencies for Windows that should be used
+// regardless of operating environment
+#if defined(WIN32) || defined(_WIN32)
+#define KXMLCORE_PLATFORM_WIN_OS 1
+#endif
+
+// PLATFORM(UNIX)
+// Operating system level dependencies for Unix-like systems that
+// should be used regardless of operating environment
+// (includes PLATFORM(DARWIN))
+#if defined(__APPLE__) \
+ || defined(unix) \
+ || defined(__unix) \
+ || defined(__unix__) \
+ || defined (__NetBSD__) \
+ || defined(_AIX)
+#define KXMLCORE_PLATFORM_UNIX 1
+#endif
+
+// Operating environments
+
+#define KXMLCORE_HAVE_OPERATING_ENVIRONMENT 0
+
+// PLATFORM(KDE)
+// Operating environment dependencies for KDE
+// I made this macro up for the KDE build system to define
+#if defined(BUILDING_KDE__)
+#define KXMLCORE_PLATFORM_KDE 1
+#undef KXMLCORE_HAVE_OPERATING_ENVIRONMENT
+#define KXMLCORE_HAVE_OPERATING_ENVIRONMENT 1
+#endif
+
+#if !KXMLCORE_HAVE_OPERATING_ENVIRONMENT && PLATFORM(DARWIN)
+#define KXMLCORE_PLATFORM_MAC 1
+#undef KXMLCORE_HAVE_OPERATING_ENVIRONMENT
+#define KXMLCORE_HAVE_OPERATING_ENVIRONMENT 1
+#endif
+
+#if !KXMLCORE_HAVE_OPERATING_ENVIRONMENT && PLATFORM(WIN_OS)
+#define KXMLCORE_PLATFORM_WIN 1
+#undef KXMLCORE_HAVE_OPERATING_ENVIRONMENT
+#define KXMLCORE_HAVE_OPERATING_ENVIRONMENT 1
+#endif
+
+// CPU
+
+// PLATFORM(PPC)
+#if defined(__ppc__) \
+ || defined(__PPC__) \
+ || defined(__powerpc__) \
+ || defined(__powerpc) \
+ || defined(__POWERPC__) \
+ || defined(_M_PPC) \
+ || defined(__PPC)
+#define KXMLCORE_PLATFORM_PPC 1
+#define KXMLCORE_PLATFORM_BIG_ENDIAN 1
+#endif
+
+// PLATFORM(PPC64)
+#if defined(__ppc64__) \
+ || defined(__PPC64__)
+#define KXMLCORE_PLATFORM_PPC64 1
+#define KXMLCORE_PLATFORM_BIG_ENDIAN 1
+#endif
+
+#if defined(arm)
+#define KXMLCORE_PLATFORM_ARM 1
+#define KXMLCORE_PLATFORM_MIDDLE_ENDIAN 1
+#endif
+
+// PLATFORM(X86)
+#if defined(__i386__) \
+ || defined(i386) \
+ || defined(_M_IX86) \
+ || defined(_X86_) \
+ || defined(__THW_INTEL)
+#define KXMLCORE_PLATFORM_X86 1
+#endif
+
+// Compiler
+
+// COMPILER(MSVC)
+#if defined(_MSC_Ver)
+#define KXMLCORE_COMPILER_MSVC 1
+#endif
+
+// COMPILER(GCC)
+#if defined(__GNUC__)
+#define KXMLCORE_COMPILER_GCC 1
+#endif
+
+// COMPILER(BORLAND)
+// not really fully supported - is this relevant any more?
+#if defined(__BORLANDC__)
+#define KXMLCORE_COMPILER_BORLAND 1
+#endif
+
+// COMPILER(CYGWIN)
+// not really fully supported - is this relevant any more?
+#if defined(__CYGWIN__)
+#define KXMLCORE_COMPILER_CYGWIN 1
+#endif
+
+// multiple threads only supported on OS X WebKit for now
+#if PLATFORM(MAC)
+#define USE_MULTIPLE_THREADS 1
+#endif
+
+#endif // KXMLCORE_PLATFORM_H
#include "config.h"
-#if defined HAVE_STDINT_H
+#if HAVE(STDINT_H)
#include <stdint.h>
-#elif defined HAVE_INTTYPES_H
+#elif HAVE(INTTYPES_H)
#include <inttypes.h>
#else
#include <sys/types.h>
#include "config.h"
#include <time.h> /* For nanosleep() */
#include <sched.h> /* For sched_yield() */
-#if defined HAVE_STDINT_H
+#if HAVE(STDINT_H)
#include <stdint.h>
-#elif defined HAVE_INTTYPES_H
+#elif HAVE(INTTYPES_H)
#include <inttypes.h>
#else
#include <sys/types.h>
#endif
#include <stdlib.h> /* for abort() */
-#if (defined __i386__ || defined __ppc__) && defined __GNUC__
+#if (PLATFORM(X86) || PLATFORM(PPC)) && COMPILER(GCC)
static void TCMalloc_SlowLock(volatile unsigned int* lockword);
// The following is a struct so that it can be initialized at compile time
inline void Lock() {
int r;
-#if __i386__
+#if PLATFORM(X86)
__asm__ __volatile__
("xchgl %0, %1"
: "=r"(r), "=m"(private_lockword_)
}
inline void Unlock() {
-#if __i386__
+#if PLATFORM(X86)
__asm__ __volatile__
("movl $0, %0"
: "=m"(private_lockword_)
sched_yield(); // Yield immediately since fast path failed
while (true) {
int r;
-#if __i386__
+#if PLATFORM(X86)
__asm__ __volatile__
("xchgl %0, %1"
: "=r"(r), "=m"(*lockword)
// Author: Sanjay Ghemawat
#include "config.h"
-#if defined HAVE_STDINT_H
+#if HAVE(STDINT_H)
#include <stdint.h>
-#elif defined HAVE_INTTYPES_H
+#elif HAVE(INTTYPES_H)
#include <inttypes.h>
#else
#include <sys/types.h>
#endif
-#ifndef WIN32
+#if !PLATFORM(WIN_OS)
#include <unistd.h>
#include <sys/mman.h>
#endif
static const int32_t FLAGS_malloc_devmem_limit = 0;
#endif
-#ifdef HAVE_SBRK
+#if HAVE(SBRK)
static void* TrySbrk(size_t size, size_t alignment) {
size = ((size + alignment - 1) / alignment) * alignment;
return reinterpret_cast<void*>(ptr);
}
-#endif /* HAVE_SBRK */
+#endif /* HAVE(SBRK) */
-#ifdef HAVE_MMAP
+#if HAVE(MMAP)
static void* TryMmap(size_t size, size_t alignment) {
// Enforce page alignment
return reinterpret_cast<void*>(ptr);
}
-#endif /* HAVE_MMAP */
+#endif /* HAVE(MMAP) */
#ifndef KXC_CHANGES
static void* TryDevMem(size_t size, size_t alignment) {
}
#endif
-#ifdef HAVE_SBRK
+#if HAVE(SBRK)
if (use_sbrk && !sbrk_failure) {
void* result = TrySbrk(size, alignment);
if (result != NULL) return result;
}
#endif
-#ifdef HAVE_MMAP
+#if HAVE(MMAP)
if (use_mmap && !mmap_failure) {
void* result = TryMmap(size, alignment);
if (result != NULL) return result;
/* This file emulates enough of unix's stdint.h on Windows
to make WebCore compile */
-#ifndef WIN32
+#if !PLATFORM(WIN_OS)
#error "This stdint.h file should only be compiled under Windows"
#endif
typedef unsigned short uint16_t;
+2006-03-02 Maciej Stachowiak <mjs@apple.com>
+
+ Not reviewed, but I noticed these trivial extra changes were needed to avoid
+ breaking the build with my reviewed patch for:
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=7387
+
+ Add config.h, includes of it, and Platform.h forwarding header.
+
+ * JSBase.cpp:
+ * JSObject.cpp:
+ * JSRun.cpp:
+ * JSUtils.cpp:
+ * JSValueWrapper.cpp:
+ * JavaScriptGlue.cpp:
+ * UserObjectImp.cpp:
+ * config.h: Added.
+ * kxmlcore/Platform.h: Added.
+
=== JavaScriptGlue-521.7 ===
2006-02-10 Geoffrey Garen <ggaren@apple.com>
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
#include "JSBase.h"
JSBase::JSBase(JSTypeID type) : fTypeID(type), fRetainCount(1)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
#include "JSObject.h"
JSUserObject::JSUserObject(JSObjectCallBacksPtr callBacks, JSObjectMarkProcPtr markProc, void *data, int dataType)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
#include "JSRun.h"
JSRun::JSRun(CFStringRef source, JSFlags inFlags)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
#include "JSUtils.h"
#include "JSBase.h"
#include "JSObject.h"
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
#include "JSValueWrapper.h"
#include "JavaScriptCore/reference_list.h"
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
#include "JavaScriptGlue.h"
#include "JSUtils.h"
#include "JSBase.h"
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
#include "UserObjectImp.h"
#include "JavaScriptCore/reference_list.h"
--- /dev/null
+#include <kxmlcore/Platform.h>
+
--- /dev/null
+#include <JavaScriptCore/Platform.h>
+2006-03-01 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Darin.
+
+ - WebCore updates for "Set up new prototype macros and avoid using #if without defined() in JSC"
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=7387
+
+ Add Platform.h
+
+ * ForwardingHeaders/kxmlcore/Platform.h: Added.
+ * bridge/mac/WebCoreFrameNamespaces.m:
+ * bridge/mac/WebCoreViewFactory.m:
+ * bridge/mac/WebDashboardRegion.m:
+ * config.h:
+ * platform/Logging.cpp:
+ * platform/mac/ScrollViewMac.mm:
+ (WebCore::ScrollView::addChild):
+ * platform/mac/WebCoreCookieAdapter.m:
+ * platform/mac/WebCoreGraphicsBridge.m:
+ * platform/mac/WebCoreHistory.m:
+ * platform/mac/WebCoreImageRendererFactory.m:
+ * platform/mac/WebCoreKeyGenerator.m:
+ * platform/mac/WebCoreView.m:
+
2006-03-02 Eric Seidel <eseidel@apple.com>
* WebCore.xcodeproj/project.pbxproj: update GraphicsContext.cpp path to fix build
Reviewed by justing.
- Update ESelectionGranulartiy enum to use newer CamelCase styling.
+ Update ESelectionGranulartiy enum to use newer CamelCase styling.
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge alterCurrentSelection:direction:granularity:]):
--- /dev/null
+#import <JavaScriptCore/Platform.h>
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
#import "WebCoreFrameNamespaces.h"
static CFSetCallBacks NonRetainingSetCallbacks = {
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
#import "WebCoreViewFactory.h"
#import <kxmlcore/Assertions.h>
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
#import "WebDashboardRegion.h"
@implementation WebDashboardRegion
return NSEqualRects (rect, [other dashboardRegionRect]) && NSEqualRects (clip, [other dashboardRegionClip]) && type == [other dashboardRegionType];
}
-@end
\ No newline at end of file
+@end
*
*/
+#include <kxmlcore/Platform.h>
+
#define KHTML_NO_XBL 1
#define KHTML_XSLT 1
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
#include "Logging.h"
KXCLogChannel LogNotYetImplemented = { 0x00000001, "WebCoreLogLevel", KXCLogChannelOff };
#ifndef NDEBUG
NSView *subview = child->getOuterView();
-
+
LOG(Frames, "Adding %p %@ at (%d,%d) w %d h %d\n", subview,
[(id)[subview class] className], x, y, (int)[subview frame].size.width, (int)[subview frame].size.height);
#endif
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import "config.h"
#import "WebCoreCookieAdapter.h"
#import <kxmlcore/Assertions.h>
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import "config.h"
#import "WebCoreGraphicsBridge.h"
#import <kxmlcore/Assertions.h>
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import "config.h"
#import <Foundation/Foundation.h>
#import "WebCoreHistory.h"
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import "config.h"
#import "WebCoreImageRendererFactory.h"
#import <kxmlcore/Assertions.h>
#import "KWQRenderTreeDebug.h"
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import "config.h"
#import "WebCoreKeyGenerator.h"
#import <kxmlcore/Assertions.h>
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
+#import "config.h"
#import "WebCoreView.h"
@interface NSClipView (WebCoreView)