Changeset 94235 in webkit for trunk/Source/JavaScriptCore/wtf


Ignore:
Timestamp:
Aug 31, 2011, 2:48:15 PM (14 years ago)
Author:
[email protected]
Message:

Add Android's platform specification and the right atomic functions.
https://bugs.webkit.org/show_bug.cgi?id=66687

Patch by Peter Beverloo <[email protected]> on 2011-08-31
Reviewed by Adam Barth.

  • wtf/Atomics.h:

(WTF::atomicIncrement):
(WTF::atomicDecrement):

  • wtf/Platform.h:
Location:
trunk/Source/JavaScriptCore/wtf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/wtf/Atomics.h

    r94191 r94235  
    6868#elif OS(QNX)
    6969#include <atomic.h>
     70#elif OS(ANDROID)
     71#include <sys/atomics.h>
    7072#elif COMPILER(GCC) && !OS(SYMBIAN)
    7173#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))
     
    102104inline int atomicDecrement(int volatile* addend) { return static_cast<int>(atomic_sub_value(reinterpret_cast<unsigned volatile*>(addend), 1)) - 1; }
    103105
     106#elif OS(ANDROID)
     107
     108inline int atomicIncrement(int volatile* addend) { return __atomic_inc(addend); }
     109inline int atomicDecrement(int volatile* addend) { return __atomic_dec(addend); }
     110
    104111#elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc
    105112#define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1
  • trunk/Source/JavaScriptCore/wtf/Platform.h

    r94192 r94235  
    177177    && !defined(__EABI__) \
    178178    && !defined(__VFP_FP__) \
    179     && !defined(_WIN32_WCE)
     179    && !defined(_WIN32_WCE) \
     180    && !defined(ANDROID)
    180181#define WTF_CPU_MIDDLE_ENDIAN 1
    181182
     
    303304   virtual memory, not to choose a GUI toolkit ==== */
    304305
     306/* OS(ANDROID) - Android */
     307#ifdef ANDROID
     308#define WTF_OS_ANDROID 1
     309#endif
     310
    305311/* OS(AIX) - AIX */
    306312#ifdef _AIX
     
    390396/* OS(UNIX) - Any Unix-like system */
    391397#if   OS(AIX)              \
     398    || OS(ANDROID)          \
    392399    || OS(DARWIN)           \
    393400    || OS(FREEBSD)          \
     
    689696#if !OS(WINDOWS) && !OS(SOLARIS) && !OS(QNX) \
    690697    && !OS(SYMBIAN) && !OS(HAIKU) && !OS(RVCT) \
    691     && !PLATFORM(BREWMP)
     698    && !OS(ANDROID) && !PLATFORM(BREWMP)
    692699#define HAVE_TM_GMTOFF 1
    693700#define HAVE_TM_ZONE 1
     
    762769#define HAVE_SYS_TIME_H 1
    763770
     771#elif OS(ANDROID)
     772
     773#define HAVE_ERRNO_H 1
     774#define HAVE_LANGINFO_H 0
     775#define HAVE_NMAP 1
     776#define HAVE_SBRK 1
     777#define HAVE_STRINGS_H 1
     778#define HAVE_SYS_PARAM_H 1
     779#define HAVE_SYS_TIME_H 1
     780
    764781#else
    765782
Note: See TracChangeset for help on using the changeset viewer.