Commit d37daa20 authored by paroga@webkit.org's avatar paroga@webkit.org

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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0fe0cf4c
2012-04-10 Patrick Gansterer <paroga@webkit.org>
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.
* config.h:
2012-04-10 Filip Pizlo <fpizlo@apple.com>
DFG should flush SetLocals to arguments
......@@ -61,14 +61,6 @@
#endif
#if OS(UNIX) || OS(WINDOWS)
#define WTF_USE_OS_RANDOMNESS 1
#endif
#if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__)
#define HAVE_PTHREAD_NP_H 1
#endif
#define WTF_CHANGES 1
#ifdef __cplusplus
......
2012-04-10 Patrick Gansterer <paroga@webkit.org>
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.
* config.h:
* wtf/Platform.h:
2012-04-10 Filip Pizlo <fpizlo@apple.com>
DFG should flush SetLocals to arguments
......
......@@ -54,14 +54,6 @@
#endif
#if OS(UNIX) || OS(WINDOWS)
#define WTF_USE_OS_RANDOMNESS 1
#endif
#if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__)
#define HAVE_PTHREAD_NP_H 1
#endif
#define WTF_CHANGES 1
#ifdef __cplusplus
......@@ -82,16 +74,3 @@
#else
#define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
#endif
#if PLATFORM(CHROMIUM)
#if !defined(WTF_USE_V8)
#define WTF_USE_V8 1
#endif
#endif /* PLATFORM(CHROMIUM) */
#if !defined(WTF_USE_V8)
#define WTF_USE_V8 0
#endif /* !defined(WTF_USE_V8) */
/* Using V8 implies not using JSC and vice versa */
#define WTF_USE_JSC !WTF_USE_V8
......@@ -447,12 +447,6 @@
#if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
#define WTF_PLATFORM_IOS 1
#define WTF_PLATFORM_IOS_SIMULATOR 1
#else
#define WTF_PLATFORM_IOS_SIMULATOR 0
#endif
#if !defined(WTF_PLATFORM_IOS)
#define WTF_PLATFORM_IOS 0
#endif
/* Graphics engines */
......@@ -478,7 +472,6 @@
#define WTF_USE_ICCJPEG 1
#elif OS(ANDROID)
#define WTF_USE_SKIA 1
#define WTF_USE_GLES2_RENDERING 0
#else
#define WTF_USE_SKIA 1
#define WTF_USE_CHROMIUM_NET 1
......@@ -576,7 +569,6 @@
#if PLATFORM(QT) && OS(DARWIN)
#define WTF_USE_CF 1
#define HAVE_DISPATCH_H 1
#endif
#if OS(DARWIN) && !PLATFORM(GTK) && !PLATFORM(QT)
......@@ -586,8 +578,6 @@
#if PLATFORM(IOS)
#define ENABLE_CONTEXT_MENUS 0
#define ENABLE_DRAG_SUPPORT 0
#define ENABLE_DATA_TRANSFER_ITEMS 0
#define ENABLE_FTPDIR 1
#define ENABLE_GEOLOCATION 1
#define ENABLE_ICONDATABASE 0
#define ENABLE_INSPECTOR 1
......@@ -599,7 +589,6 @@
#define HAVE_NETWORK_CFDATA_ARRAY_CALLBACK 1
#define HAVE_PTHREAD_RWLOCK 1
#define HAVE_READLINE 1
#define HAVE_RUNLOOP_TIMER 0
#define WTF_USE_CF 1
#define WTF_USE_CFNETWORK 1
#define WTF_USE_PTHREADS 1
......@@ -619,7 +608,6 @@
#if PLATFORM(WIN) && !OS(WINCE)
#define WTF_USE_CF 1
#define WTF_USE_PTHREADS 0
#endif
#if PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(CHROMIUM) && !PLATFORM(WIN_CAIRO)
......@@ -671,6 +659,11 @@
#if OS(UNIX)
#define HAVE_SIGNAL_H 1
#define WTF_USE_OS_RANDOMNESS 1
#endif
#if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__)
#define HAVE_PTHREAD_NP_H 1
#endif
#if !defined(HAVE_VASPRINTF)
......@@ -726,14 +719,13 @@
#elif OS(WINDOWS)
#if OS(WINCE)
#define HAVE_ERRNO_H 0
#else
#if !OS(WINCE)
#define HAVE_SYS_TIMEB_H 1
#define HAVE_ALIGNED_MALLOC 1
#define HAVE_ISDEBUGGERPRESENT 1
#endif
#define HAVE_VIRTUALALLOC 1
#define WTF_USE_OS_RANDOMNESS 1
#elif OS(QNX)
......@@ -750,7 +742,6 @@
#elif OS(ANDROID)
#define HAVE_ERRNO_H 1
#define HAVE_LANGINFO_H 0
#define HAVE_NMAP 1
#define HAVE_SBRK 1
#define HAVE_STRINGS_H 1
......@@ -781,12 +772,6 @@
#endif
#endif
/* fastMalloc match validation allows for runtime verification that
new is matched by delete, fastMalloc is matched by fastFree, etc. */
#if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION)
#define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0
#endif
#if !defined(ENABLE_ICONDATABASE)
#define ENABLE_ICONDATABASE 1
#endif
......@@ -811,46 +796,14 @@
#define ENABLE_DRAG_SUPPORT 1
#endif
#if !defined(ENABLE_DATA_TRANSFER_ITEMS)
#define ENABLE_DATA_TRANSFER_ITEMS 0
#endif
#if !defined(ENABLE_DASHBOARD_SUPPORT)
#define ENABLE_DASHBOARD_SUPPORT 0
#endif
#if !defined(ENABLE_INSPECTOR)
#define ENABLE_INSPECTOR 1
#endif
#if !defined(ENABLE_JAVA_BRIDGE)
#define ENABLE_JAVA_BRIDGE 0
#endif
#if !defined(ENABLE_NETSCAPE_PLUGIN_API)
#define ENABLE_NETSCAPE_PLUGIN_API 1
#endif
#if !defined(ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE)
#define ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE 0
#endif
#if !defined(ENABLE_PURGEABLE_MEMORY)
#define ENABLE_PURGEABLE_MEMORY 0
#endif
#if !defined(WTF_USE_PLUGIN_HOST_PROCESS)
#define WTF_USE_PLUGIN_HOST_PROCESS 0
#endif
#if !defined(ENABLE_ORIENTATION_EVENTS)
#define ENABLE_ORIENTATION_EVENTS 0
#endif
#if !defined(ENABLE_OPCODE_STATS)
#define ENABLE_OPCODE_STATS 0
#endif
#if !defined(ENABLE_GLOBAL_FASTMALLOC_NEW)
#define ENABLE_GLOBAL_FASTMALLOC_NEW 1
#endif
......@@ -868,34 +821,10 @@
#define ENABLE_SAMPLING_THREAD 1
#endif
#if !defined(ENABLE_GEOLOCATION)
#define ENABLE_GEOLOCATION 0
#endif
#if !defined(ENABLE_VIEWPORT)
#define ENABLE_VIEWPORT 0
#endif
#if !defined(ENABLE_NOTIFICATIONS)
#define ENABLE_NOTIFICATIONS 0
#endif
#if PLATFORM(IOS)
#define ENABLE_TEXT_CARET 0
#endif
#if !defined(ENABLE_TEXT_CARET)
#if !defined(ENABLE_TEXT_CARET) && !PLATFORM(IOS)
#define ENABLE_TEXT_CARET 1
#endif
#if !defined(ENABLE_FULLSCREEN_API)
#define ENABLE_FULLSCREEN_API 0
#endif
#if !defined(ENABLE_POINTER_LOCK)
#define ENABLE_POINTER_LOCK 0
#endif
#if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64)
#if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS))) \
|| (CPU(IA64) && !CPU(IA64_32)) \
......@@ -909,10 +838,6 @@
#endif
#endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64) */
#if !defined(ENABLE_REPAINT_THROTTLING)
#define ENABLE_REPAINT_THROTTLING 0
#endif
/* Disable the JIT on versions of GCC prior to 4.1 */
#if !defined(ENABLE_JIT) && COMPILER(GCC) && !GCC_VERSION_AT_LEAST(4, 1, 0)
#define ENABLE_JIT 0
......@@ -923,6 +848,10 @@
#define ENABLE_JIT 0
#endif
#if !defined(ENABLE_JIT) && CPU(SH4) && PLATFORM(QT)
#define ENABLE_JIT 1
#endif
/* The JIT is enabled by default on all x86, x86-64, ARM & MIPS platforms. */
#if !defined(ENABLE_JIT) \
&& (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(MIPS)) \
......@@ -979,10 +908,6 @@
#error You have to have at least one execution model enabled to build JSC
#endif
#if CPU(SH4) && PLATFORM(QT)
#define ENABLE_JIT 1
#endif
/* Configure the JIT */
#if CPU(X86) && COMPILER(MSVC)
#define JSC_HOST_CALL __fastcall
......@@ -1004,10 +929,7 @@
#define ENABLE_REGEXP_TRACING 0
/* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */
#if PLATFORM(CHROMIUM)
#define ENABLE_YARR_JIT 0
#elif ENABLE(JIT) && !defined(ENABLE_YARR_JIT)
#if !defined(ENABLE_YARR_JIT) && ENABLE(JIT) && !PLATFORM(CHROMIUM)
#define ENABLE_YARR_JIT 1
/* Setting this flag compares JIT results with interpreter results. */
......@@ -1032,14 +954,6 @@
#define ENABLE_PAN_SCROLLING 1
#endif
#if !defined(ENABLE_SMOOTH_SCROLLING)
#define ENABLE_SMOOTH_SCROLLING 0
#endif
#if !defined(ENABLE_WEB_ARCHIVE)
#define ENABLE_WEB_ARCHIVE 0
#endif
/* Use the QXmlStreamReader implementation for XMLDocumentParser */
/* Use the QXmlQuery implementation for XSLTProcessor */
#if PLATFORM(QT)
......@@ -1069,12 +983,6 @@
#define ENABLE_CSS_IMAGE_SET 1
#endif
#if !defined(ENABLE_CSS_SHADERS)
#if PLATFORM(MAC) || PLATFORM(IOS)
#define ENABLE_CSS_SHADERS 0
#endif
#endif
/* Compositing on the UI-process in WebKit2 */
#if PLATFORM(QT)
#define WTF_USE_UI_SIDE_COMPOSITING 1
......@@ -1128,10 +1036,8 @@
since most ports try to support sub-project independence, adding new headers
to WTF causes many ports to break, and so this way we can address the build
breakages one port at a time. */
#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(WX)
#if !defined(WTF_USE_EXPORT_MACROS) && (PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(WX))
#define WTF_USE_EXPORT_MACROS 1
#else
#define WTF_USE_EXPORT_MACROS 0
#endif
#if (PLATFORM(QT) && !OS(DARWIN)) || PLATFORM(GTK) || PLATFORM(EFL)
......@@ -1146,11 +1052,9 @@
#define ENABLE_PARALLEL_GC 1
#endif
#ifndef NDEBUG
#ifndef ENABLE_GC_VALIDATION
#if !defined(ENABLE_GC_VALIDATION) && !defined(NDEBUG)
#define ENABLE_GC_VALIDATION 1
#endif
#endif
#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
#define WTF_USE_AVFOUNDATION 1
......@@ -1176,27 +1080,19 @@
#define WTF_USE_COREAUDIO 1
#endif
#if PLATFORM(CHROMIUM)
#if !defined(WTF_USE_V8)
#if !defined(WTF_USE_V8) && PLATFORM(CHROMIUM)
#define WTF_USE_V8 1
#endif
#endif /* PLATFORM(CHROMIUM) */
#if !defined(WTF_USE_V8)
#define WTF_USE_V8 0
#endif /* !defined(WTF_USE_V8) */
/* Using V8 implies not using JSC and vice versa */
#define WTF_USE_JSC !WTF_USE_V8
/* Not using V8 implies using JSC and vice versa */
#if !USE(V8)
#define WTF_USE_JSC 1
#endif
#if ENABLE(NOTIFICATIONS) && PLATFORM(MAC)
#define ENABLE_TEXT_NOTIFICATIONS_ONLY 1
#endif
#if !defined(WTF_USE_WTFURL)
#define WTF_USE_WTFURL 0
#endif
#if !defined(WTF_USE_ZLIB) && !PLATFORM(QT)
#define WTF_USE_ZLIB 1
#endif
......
2012-04-10 Patrick Gansterer <paroga@webkit.org>
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.
* config.h:
2012-04-10 Adam Barth <abarth@webkit.org>
Limit -apple- and -khtml- to ENABLE(DASHBOARD_SUPPORT)
......@@ -122,10 +122,6 @@
#define WTF_USE_NEW_THEME 1
#endif // PLATFORM(MAC)
#if OS(UNIX) || OS(WINDOWS)
#define WTF_USE_OS_RANDOMNESS 1
#endif
#if PLATFORM(CHROMIUM)
// Chromium uses this file instead of JavaScriptCore/config.h to compile
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment