Ignore:
Timestamp:
Mar 2, 2006, 1:12:06 AM (19 years ago)
Author:
mjs
Message:

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.


  • 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:

JavaScriptGlue:

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.

WebCore:

Reviewed by Darin.


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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/date_object.cpp

    r13015 r13089  
    2323#include "date_object.h"
    2424
    25 #if HAVE_ERRNO_H
     25#if HAVE(ERRNO_H)
    2626#include <errno.h>
    2727#endif
    2828
    29 #if HAVE_SYS_PARAM_H
     29#if HAVE(SYS_PARAM_H)
    3030#include <sys/param.h>
    3131#endif
    3232
    33 #if HAVE_SYS_TIME_H
     33#if HAVE(SYS_TIME_H)
    3434#include <sys/time.h>
    3535#endif
    3636
    37 #if HAVE_SYS_TIMEB_H
     37#if HAVE(SYS_TIMEB_H)
    3838#include <sys/timeb.h>
    3939#endif
     
    5252#include "operations.h"
    5353
    54 #if __APPLE__
     54#if PLATFORM(MAC)
    5555#include <CoreFoundation/CoreFoundation.h>
    5656#endif
    5757
    58 #if WIN32
     58#if PLATFORM(WIN_OS)
    5959#define copysign(x, y) _copysign(x, y)
    6060#define isfinite(x) _finite(x)
     
    6565inline int gmtoffset(const tm& t)
    6666{
    67 #if WIN32
     67#if PLATFORM(WIN_OS)
    6868    // Time is supposed to be in the current timezone.
    6969    // FIXME: Use undocumented _dstbias?
     
    142142static void millisecondsToTM(double milli, bool utc, tm *t);
    143143
    144 #if __APPLE__
     144#if PLATFORM(MAC)
    145145
    146146static CFDateFormatterStyle styleFromArgString(const UString& string, CFDateFormatterStyle defaultStyle)
     
    207207}
    208208
    209 #endif // __APPLE__
     209#endif // PLATFORM(MAC)
    210210
    211211static UString formatDate(const tm &t)
     
    231231    char buffer[100];
    232232    if (utc) {
    233 #if !WIN32
     233        // FIXME: why not on windows?
     234#if !PLATFORM(WIN_OS)
    234235        ASSERT(t.tm_gmtoff == 0);
    235236#endif
     
    554555  JSValue *result = 0;
    555556  UString s;
    556 #if !__APPLE__
     557#if !PLATFORM(DARWIN)
    557558  const int bufsize=100;
    558559  char timebuffer[bufsize];
     
    610611    return jsString(formatDateUTCVariant(t) + " " + formatTime(t, utc));
    611612    break;
    612 #if __APPLE__
     613#if PLATFORM(MAC)
    613614  case ToLocaleString:
    614615    return jsString(formatLocaleDate(exec, secs, true, true, args));
     
    735736
    736737  if (numArgs == 0) { // new Date() ECMA 15.9.3.3
    737 #if !WIN32
     738#if PLATFORM(WIN_OS)
     739#if COMPILER(BORLAND)
     740    struct timeb timebuffer;
     741    ftime(&timebuffer);
     742#else
     743    struct _timeb timebuffer;
     744    _ftime(&timebuffer);
     745#endif
     746    double utc = timebuffer.time * msPerSecond + timebuffer.millitm;
     747#else
    738748    struct timeval tv;
    739749    gettimeofday(&tv, 0);
    740750    double utc = floor(tv.tv_sec * msPerSecond + tv.tv_usec / 1000);
    741 #else
    742 #  if __BORLANDC__
    743     struct timeb timebuffer;
    744     ftime(&timebuffer);
    745 #  else
    746     struct _timeb timebuffer;
    747     _ftime(&timebuffer);
    748 #  endif
    749     double utc = timebuffer.time * msPerSecond + timebuffer.millitm;
    750751#endif
    751752    value = utc;
     
    855856// obsolete time zones not listed here equivalent to "-0000".
    856857static const struct KnownZone {
    857 #if !WIN32
     858#if !PLATFORM(WIN_OS)
    858859    const
    859860#endif
     
    878879    if (utc) {
    879880        time_t zero = 0;
    880 #if !WIN32
     881#if PLATFORM(WIN_OS)
     882        // FIXME: not thread safe
     883        (void)localtime(&zero);
     884#if COMPILER(BORLAND) || COMPILER(CYGWIN)
     885        utcOffset = - _timezone;
     886#else
     887        utcOffset = - timezone;
     888#endif
     889        t->tm_isdst = 0;
     890#else
    881891        tm t3;
    882892        localtime_r(&zero, &t3);
    883893        utcOffset = t3.tm_gmtoff;
    884894        t->tm_isdst = t3.tm_isdst;
    885 #else
    886         // FIXME: not thread safe
    887         (void)localtime(&zero);
    888 #  if __BORLANDC__ || __CYGWIN__
    889         utcOffset = - _timezone;
    890 #  else
    891         utcOffset = - timezone;
    892 #  endif
    893         t->tm_isdst = 0;
    894895#endif
    895896    } else {
Note: See TracChangeset for help on using the changeset viewer.