Changeset 113798 in webkit


Ignore:
Timestamp:
Apr 10, 2012 6:09:07 PM (12 years ago)
Author:
Patrick Gansterer
Message:

Cleanup wtf/Platform.h and config.h files
https://bugs.webkit.org/show_bug.cgi?id=83431

Reviewed by Eric Seidel.

The ENABLE() and USE() macros take care about the case when the flag
isn't defined. So there is no need to define anything with 0.

Also move duplicated code from the config.h files to Platform.h and
merge a few preprocessor commands to make the file more readable.

Source/JavaScriptCore:

  • config.h:

Source/WebCore:

  • config.h:

Source/WTF:

  • config.h:
  • wtf/Platform.h:
Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r113796 r113798  
     12012-04-10  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Cleanup wtf/Platform.h and config.h files
     4        https://bugs.webkit.org/show_bug.cgi?id=83431
     5
     6        Reviewed by Eric Seidel.
     7
     8        The ENABLE() and USE() macros take care about the case when the flag
     9        isn't defined. So there is no need to define anything with 0.
     10
     11        Also move duplicated code from the config.h files to Platform.h and
     12        merge a few preprocessor commands to make the file more readable.
     13
     14        * config.h:
     15
    1162012-04-10  Filip Pizlo  <fpizlo@apple.com>
    217
  • trunk/Source/JavaScriptCore/config.h

    r113571 r113798  
    6262#endif
    6363
    64 #if OS(UNIX) || OS(WINDOWS)
    65 #define WTF_USE_OS_RANDOMNESS 1
    66 #endif
    67 
    68 #if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__)
    69 #define HAVE_PTHREAD_NP_H 1
    70 #endif
    71 
    7264#define WTF_CHANGES 1
    7365
  • trunk/Source/WTF/ChangeLog

    r113796 r113798  
     12012-04-10  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Cleanup wtf/Platform.h and config.h files
     4        https://bugs.webkit.org/show_bug.cgi?id=83431
     5
     6        Reviewed by Eric Seidel.
     7
     8        The ENABLE() and USE() macros take care about the case when the flag
     9        isn't defined. So there is no need to define anything with 0.
     10
     11        Also move duplicated code from the config.h files to Platform.h and
     12        merge a few preprocessor commands to make the file more readable.
     13
     14        * config.h:
     15        * wtf/Platform.h:
     16
    1172012-04-10  Filip Pizlo  <fpizlo@apple.com>
    218
  • trunk/Source/WTF/config.h

    r113571 r113798  
    5555#endif
    5656
    57 #if OS(UNIX) || OS(WINDOWS)
    58 #define WTF_USE_OS_RANDOMNESS 1
    59 #endif
    60 
    61 #if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__)
    62 #define HAVE_PTHREAD_NP_H 1
    63 #endif
    64 
    6557#define WTF_CHANGES 1
    6658
     
    8375#define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
    8476#endif
    85 
    86 #if PLATFORM(CHROMIUM)
    87 #if !defined(WTF_USE_V8)
    88 #define WTF_USE_V8 1
    89 #endif
    90 #endif /* PLATFORM(CHROMIUM) */
    91 
    92 #if !defined(WTF_USE_V8)
    93 #define WTF_USE_V8 0
    94 #endif /* !defined(WTF_USE_V8) */
    95 
    96 /* Using V8 implies not using JSC and vice versa */
    97 #define WTF_USE_JSC !WTF_USE_V8
  • trunk/Source/WTF/wtf/Platform.h

    r113505 r113798  
    448448#define WTF_PLATFORM_IOS 1
    449449#define WTF_PLATFORM_IOS_SIMULATOR 1
    450 #else
    451 #define WTF_PLATFORM_IOS_SIMULATOR 0
    452 #endif
    453 
    454 #if !defined(WTF_PLATFORM_IOS)
    455 #define WTF_PLATFORM_IOS 0
    456450#endif
    457451
     
    479473#elif OS(ANDROID)
    480474#define WTF_USE_SKIA 1
    481 #define WTF_USE_GLES2_RENDERING 0
    482475#else
    483476#define WTF_USE_SKIA 1
     
    577570#if PLATFORM(QT) && OS(DARWIN)
    578571#define WTF_USE_CF 1
    579 #define HAVE_DISPATCH_H 1
    580572#endif
    581573
     
    587579#define ENABLE_CONTEXT_MENUS 0
    588580#define ENABLE_DRAG_SUPPORT 0
    589 #define ENABLE_DATA_TRANSFER_ITEMS 0
    590 #define ENABLE_FTPDIR 1
    591581#define ENABLE_GEOLOCATION 1
    592582#define ENABLE_ICONDATABASE 0
     
    600590#define HAVE_PTHREAD_RWLOCK 1
    601591#define HAVE_READLINE 1
    602 #define HAVE_RUNLOOP_TIMER 0
    603592#define WTF_USE_CF 1
    604593#define WTF_USE_CFNETWORK 1
     
    620609#if PLATFORM(WIN) && !OS(WINCE)
    621610#define WTF_USE_CF 1
    622 #define WTF_USE_PTHREADS 0
    623611#endif
    624612
     
    672660#if OS(UNIX)
    673661#define HAVE_SIGNAL_H 1
     662#define WTF_USE_OS_RANDOMNESS 1
     663#endif
     664
     665#if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__)
     666#define HAVE_PTHREAD_NP_H 1
    674667#endif
    675668
     
    727720#elif OS(WINDOWS)
    728721
    729 #if OS(WINCE)
    730 #define HAVE_ERRNO_H 0
    731 #else
     722#if !OS(WINCE)
    732723#define HAVE_SYS_TIMEB_H 1
    733724#define HAVE_ALIGNED_MALLOC 1
     
    735726#endif
    736727#define HAVE_VIRTUALALLOC 1
     728#define WTF_USE_OS_RANDOMNESS 1
    737729
    738730#elif OS(QNX)
     
    751743
    752744#define HAVE_ERRNO_H 1
    753 #define HAVE_LANGINFO_H 0
    754745#define HAVE_NMAP 1
    755746#define HAVE_SBRK 1
     
    782773#endif
    783774
    784 /* fastMalloc match validation allows for runtime verification that
    785    new is matched by delete, fastMalloc is matched by fastFree, etc. */
    786 #if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION)
    787 #define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0
    788 #endif
    789 
    790775#if !defined(ENABLE_ICONDATABASE)
    791776#define ENABLE_ICONDATABASE 1
     
    812797#endif
    813798
    814 #if !defined(ENABLE_DATA_TRANSFER_ITEMS)
    815 #define ENABLE_DATA_TRANSFER_ITEMS 0
    816 #endif
    817 
    818 #if !defined(ENABLE_DASHBOARD_SUPPORT)
    819 #define ENABLE_DASHBOARD_SUPPORT 0
    820 #endif
    821 
    822799#if !defined(ENABLE_INSPECTOR)
    823800#define ENABLE_INSPECTOR 1
    824801#endif
    825802
    826 #if !defined(ENABLE_JAVA_BRIDGE)
    827 #define ENABLE_JAVA_BRIDGE 0
    828 #endif
    829 
    830803#if !defined(ENABLE_NETSCAPE_PLUGIN_API)
    831804#define ENABLE_NETSCAPE_PLUGIN_API 1
    832 #endif
    833 
    834 #if !defined(ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE)
    835 #define ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE 0
    836 #endif
    837 
    838 #if !defined(ENABLE_PURGEABLE_MEMORY)
    839 #define ENABLE_PURGEABLE_MEMORY 0
    840 #endif
    841 
    842 #if !defined(WTF_USE_PLUGIN_HOST_PROCESS)
    843 #define WTF_USE_PLUGIN_HOST_PROCESS 0
    844 #endif
    845 
    846 #if !defined(ENABLE_ORIENTATION_EVENTS)
    847 #define ENABLE_ORIENTATION_EVENTS 0
    848 #endif
    849 
    850 #if !defined(ENABLE_OPCODE_STATS)
    851 #define ENABLE_OPCODE_STATS 0
    852805#endif
    853806
     
    869822#endif
    870823
    871 #if !defined(ENABLE_GEOLOCATION)
    872 #define ENABLE_GEOLOCATION 0
    873 #endif
    874 
    875 #if !defined(ENABLE_VIEWPORT)
    876 #define ENABLE_VIEWPORT 0
    877 #endif
    878 
    879 #if !defined(ENABLE_NOTIFICATIONS)
    880 #define ENABLE_NOTIFICATIONS 0
    881 #endif
    882 
    883 #if PLATFORM(IOS)
    884 #define ENABLE_TEXT_CARET 0
    885 #endif
    886 
    887 #if !defined(ENABLE_TEXT_CARET)
     824#if !defined(ENABLE_TEXT_CARET) && !PLATFORM(IOS)
    888825#define ENABLE_TEXT_CARET 1
    889 #endif
    890 
    891 #if !defined(ENABLE_FULLSCREEN_API)
    892 #define ENABLE_FULLSCREEN_API 0
    893 #endif
    894 
    895 #if !defined(ENABLE_POINTER_LOCK)
    896 #define ENABLE_POINTER_LOCK 0
    897826#endif
    898827
     
    910839#endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64) */
    911840
    912 #if !defined(ENABLE_REPAINT_THROTTLING)
    913 #define ENABLE_REPAINT_THROTTLING 0
    914 #endif
    915 
    916841/* Disable the JIT on versions of GCC prior to 4.1 */
    917842#if !defined(ENABLE_JIT) && COMPILER(GCC) && !GCC_VERSION_AT_LEAST(4, 1, 0)
     
    922847#if !defined(ENABLE_JIT) && OS(WINDOWS) && CPU(X86_64)
    923848#define ENABLE_JIT 0
     849#endif
     850
     851#if !defined(ENABLE_JIT) && CPU(SH4) && PLATFORM(QT)
     852#define ENABLE_JIT 1
    924853#endif
    925854
     
    980909#endif
    981910
    982 #if CPU(SH4) && PLATFORM(QT)
    983 #define ENABLE_JIT 1
    984 #endif
    985 
    986911/* Configure the JIT */
    987912#if CPU(X86) && COMPILER(MSVC)
     
    1005930
    1006931/* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */
    1007 #if PLATFORM(CHROMIUM)
    1008 #define ENABLE_YARR_JIT 0
    1009 
    1010 #elif ENABLE(JIT) && !defined(ENABLE_YARR_JIT)
     932#if !defined(ENABLE_YARR_JIT) && ENABLE(JIT) && !PLATFORM(CHROMIUM)
    1011933#define ENABLE_YARR_JIT 1
    1012934
     
    1031953#if !defined(ENABLE_PAN_SCROLLING) && OS(WINDOWS)
    1032954#define ENABLE_PAN_SCROLLING 1
    1033 #endif
    1034 
    1035 #if !defined(ENABLE_SMOOTH_SCROLLING)
    1036 #define ENABLE_SMOOTH_SCROLLING 0
    1037 #endif
    1038 
    1039 #if !defined(ENABLE_WEB_ARCHIVE)
    1040 #define ENABLE_WEB_ARCHIVE 0
    1041955#endif
    1042956
     
    1070984#endif
    1071985
    1072 #if !defined(ENABLE_CSS_SHADERS)
    1073 #if PLATFORM(MAC) || PLATFORM(IOS)
    1074 #define ENABLE_CSS_SHADERS 0
    1075 #endif
    1076 #endif
    1077 
    1078986/* Compositing on the UI-process in WebKit2 */
    1079987#if PLATFORM(QT)
     
    11291037   to WTF causes many ports to break, and so this way we can address the build
    11301038   breakages one port at a time. */
    1131 #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(WX)
     1039#if !defined(WTF_USE_EXPORT_MACROS) && (PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(WX))
    11321040#define WTF_USE_EXPORT_MACROS 1
    1133 #else
    1134 #define WTF_USE_EXPORT_MACROS 0
    11351041#endif
    11361042
     
    11471053#endif
    11481054
    1149 #ifndef NDEBUG
    1150 #ifndef ENABLE_GC_VALIDATION
     1055#if !defined(ENABLE_GC_VALIDATION) && !defined(NDEBUG)
    11511056#define ENABLE_GC_VALIDATION 1
    1152 #endif
    11531057#endif
    11541058
     
    11771081#endif
    11781082
    1179 #if PLATFORM(CHROMIUM)
    1180 #if !defined(WTF_USE_V8)
     1083#if !defined(WTF_USE_V8) && PLATFORM(CHROMIUM)
    11811084#define WTF_USE_V8 1
    11821085#endif
    1183 #endif /* PLATFORM(CHROMIUM) */
    1184 
    1185 #if !defined(WTF_USE_V8)
    1186 #define WTF_USE_V8 0
    1187 #endif /* !defined(WTF_USE_V8) */
    1188 
    1189 /* Using V8 implies not using JSC and vice versa */
    1190 #define WTF_USE_JSC !WTF_USE_V8
     1086
     1087/* Not using V8 implies using JSC and vice versa */
     1088#if !USE(V8)
     1089#define WTF_USE_JSC 1
     1090#endif
    11911091
    11921092#if ENABLE(NOTIFICATIONS) && PLATFORM(MAC)
     
    11941094#endif
    11951095
    1196 #if !defined(WTF_USE_WTFURL)
    1197 #define WTF_USE_WTFURL 0
    1198 #endif
    1199 
    12001096#if !defined(WTF_USE_ZLIB) && !PLATFORM(QT)
    12011097#define WTF_USE_ZLIB 1
  • trunk/Source/WebCore/ChangeLog

    r113795 r113798  
     12012-04-10  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Cleanup wtf/Platform.h and config.h files
     4        https://bugs.webkit.org/show_bug.cgi?id=83431
     5
     6        Reviewed by Eric Seidel.
     7
     8        The ENABLE() and USE() macros take care about the case when the flag
     9        isn't defined. So there is no need to define anything with 0.
     10
     11        Also move duplicated code from the config.h files to Platform.h and
     12        merge a few preprocessor commands to make the file more readable.
     13
     14        * config.h:
     15
    1162012-04-10  Adam Barth  <abarth@webkit.org>
    217
  • trunk/Source/WebCore/config.h

    r112275 r113798  
    123123#endif // PLATFORM(MAC)
    124124
    125 #if OS(UNIX) || OS(WINDOWS)
    126 #define WTF_USE_OS_RANDOMNESS 1
    127 #endif
    128 
    129125#if PLATFORM(CHROMIUM)
    130126
Note: See TracChangeset for help on using the changeset viewer.