Ignore:
Timestamp:
Sep 3, 2005, 6:18:13 PM (20 years ago)
Author:
darin
Message:

Reviewed, tweaked and landed by Darin.

  • some Windows compilation fixes, hoping to fix the problems reported in these bugs: 4627, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 4637, 4639, 4640, 4641, 4644, 4645
  • kjs/collector.cpp: Include <windows.h> on WIN32. Put thread-related code inside KJS_MULTIPLE_THREADS #if directives. (KJS::Collector::markCurrentThreadConservatively): Use NT_TIB to find the stack base on Win32.
  • kjs/config.h: Define HAVE_SYS_TIMEB_H for Win32.
  • kjs/date_object.cpp: Add include of <limits.h>. Add definitions of strncasecmp, isfinite, and copysign for Win32. (KJS::KRFCDate_parseDate): Move "errno = 0" line down closer to the first call to strol -- I believe that on Win32 there's some other call before that setting errno.
  • kjs/date_object.h: Remove unneeded include of <sys/time.h>.
  • kjs/dtoa.cpp: Add an undef of strtod, needed on Win32.
  • kjs/fast_malloc.cpp: Put #if !WIN32 around some customization that's not appropriate on Win32. (KJS::region_list_append): Add a missing cast so this Win32-specific function compiles in C++. (KJS::sbrk): Change parameter type to match the declaration.
  • kjs/function.cpp: (isxdigit): Define a locale-independent isxdigit on Win32.
  • kjs/function.h: Remove unneeded friend class Function for FunctionImp.
  • kjs/identifier.cpp: Took out the APPLE_CHANGES from around the AVOID_STATIC_CONSTRUCTORS define. We ultimately intend to phase out APPLE_CHANGES entirely. Also fix the non-AVOID_STATIC_CONSTRUCTORS code path.
  • kjs/internal.cpp: Remove uneeded include of <strings.h>, which was confused with <string.h>! Add a Win32 implementation of copysign. Put the threads code inside KJS_MULTIPLE_THREADS.
  • kjs/internal.h: Define a KJS_MULTIPLE_THREADS macro on non-Win32 only. Later we can make this specific to Mac OS X if we like.
  • kjs/interpreter_map.cpp: Add missing include of <stdlib.h>.
  • kjs/list.cpp: (KJS::ListImp::markValues): Use std::min instead of MIN. (KJS::List::copy): Ditto. (KJS::List::copyTail): Ditto.
  • kjs/math_object.cpp: (signbit): Add a Win32 implementation of signbit.
  • kjs/nodes.cpp: (Node::finalCheck): Use unsigned instead of uint. Put the use of always_inline inside GNUC.
  • kjs/number_object.cpp: (NumberProtoFuncImp::callAsFunction): Use "10.0" instead of "10" inside all the calls to pow to avoid ambiguity caused by overloading of pow on Win32, seen when passing an int rather than a double or float.
  • kjs/operations.cpp: (KJS::isInf): Add Win32 implementation. (KJS::isPosInf): Add Win32 implementation. (KJS::isNegInf): Add Win32 implementation.
  • kjs/regexp.cpp: Use unsigned instead of uint.
  • kjs/regexp.h: Ditto.
  • kjs/regexp_object.cpp: Ditto.
  • kjs/regexp_object.h: Ditto.
File:
1 edited

Legend:

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

    r10447 r10456  
    227227#include "fast_malloc.h"
    228228
     229#define MALLOC_FAILURE_ACTION abort()
     230
     231#if !WIN32
    229232#define MORECORE_CONTIGUOUS 0
    230233#define MORECORE_CANNOT_TRIM 1
    231 #define MALLOC_FAILURE_ACTION abort()
     234#endif
    232235
    233236namespace KJS {
     
    302305static long getpagesize(void);
    303306static long getregionsize(void);
    304 static void *sbrk(long size);
     307static void *sbrk(ptrdiff_t size);
    305308static void *mmap(void *ptr, long size, long prot, long type, long handle, long arg);
    306309static long munmap(void *ptr, long size);
     
    50295032/* Allocate and link a region entry in the region list */
    50305033static int region_list_append (region_list_entry **last, void *base_reserved, long reserve_size) {
    5031     region_list_entry *next = HeapAlloc (GetProcessHeap (), 0, sizeof (region_list_entry));
     5034    region_list_entry *next = (region_list_entry *) HeapAlloc (GetProcessHeap (), 0, sizeof (region_list_entry));
    50325035    if (! next)
    50335036        return FALSE;
     
    50585061
    50595062/* sbrk for windows */
    5060 static void *sbrk (long size) {
     5063static void *sbrk (ptrdiff_t size) {
    50615064    static long g_pagesize, g_my_pagesize;
    50625065    static long g_regionsize, g_my_regionsize;
     
    50645067    void *result = (void *) MORECORE_FAILURE;
    50655068#ifdef TRACE
    5066     printf ("sbrk %d\n", size);
     5069    printf ("sbrk %ld\n", (long) size);
    50675070#endif
    50685071#if defined (USE_MALLOC_LOCK) && defined (NEEDED)
Note: See TracChangeset for help on using the changeset viewer.