Title: [139974] trunk/Source/WTF
Revision
139974
Author
zandober...@gmail.com
Date
2013-01-17 02:04:45 -0800 (Thu, 17 Jan 2013)

Log Message

[Autotools] Unify WTF sources list regardless of the target OS, Unicode backend
https://bugs.webkit.org/show_bug.cgi?id=105886

Reviewed by Gustavo Noronha Silva.

Rather than including files in the sources list in an OS-specific way,
guard specific files with OS(UNIX|WINDOWS), USE((GLIB|ICU)_UNICODE) guards
and include all of them in the list.

Proper comments for namespace and #if guard closings are also added or adjusted
where necessary in the affected files.

* GNUmakefile.list.am:
* wtf/OSAllocatorPosix.cpp: Add OS(UNIX) guards.
* wtf/OSAllocatorWin.cpp: Add OS(WINDOWS) guards.
* wtf/ThreadSpecificWin.cpp: Ditto.
* wtf/ThreadingWin.cpp: Ditto.
* wtf/unicode/glib/UnicodeGLib.cpp: Add USE(GLIB_UNICODE) guards.
(WTF):
* wtf/unicode/glib/UnicodeGLib.h: Ditto.
(WTF):
* wtf/unicode/icu/CollatorICU.cpp: Style changes.
* wtf/unicode/icu/UnicodeIcu.h: Add USE(ICU_UNICODE) guards.
(WTF):
* wtf/win/OwnPtrWin.cpp: Add OS(WINDOWS) guards.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (139973 => 139974)


--- trunk/Source/WTF/ChangeLog	2013-01-17 09:58:56 UTC (rev 139973)
+++ trunk/Source/WTF/ChangeLog	2013-01-17 10:04:45 UTC (rev 139974)
@@ -1,3 +1,31 @@
+2013-01-17  Zan Dobersek  <zdober...@igalia.com>
+
+        [Autotools] Unify WTF sources list regardless of the target OS, Unicode backend
+        https://bugs.webkit.org/show_bug.cgi?id=105886
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Rather than including files in the sources list in an OS-specific way,
+        guard specific files with OS(UNIX|WINDOWS), USE((GLIB|ICU)_UNICODE) guards
+        and include all of them in the list.
+
+        Proper comments for namespace and #if guard closings are also added or adjusted
+        where necessary in the affected files.
+
+        * GNUmakefile.list.am:
+        * wtf/OSAllocatorPosix.cpp: Add OS(UNIX) guards.
+        * wtf/OSAllocatorWin.cpp: Add OS(WINDOWS) guards.
+        * wtf/ThreadSpecificWin.cpp: Ditto.
+        * wtf/ThreadingWin.cpp: Ditto.
+        * wtf/unicode/glib/UnicodeGLib.cpp: Add USE(GLIB_UNICODE) guards.
+        (WTF):
+        * wtf/unicode/glib/UnicodeGLib.h: Ditto.
+        (WTF):
+        * wtf/unicode/icu/CollatorICU.cpp: Style changes.
+        * wtf/unicode/icu/UnicodeIcu.h: Add USE(ICU_UNICODE) guards.
+        (WTF):
+        * wtf/win/OwnPtrWin.cpp: Add OS(WINDOWS) guards.
+
 2013-01-16  Benjamin Poulain  <benja...@webkit.org>
 
         Use GCC's implementation of atomicIncrement/Decrement on Mac

Modified: trunk/Source/WTF/GNUmakefile.list.am (139973 => 139974)


--- trunk/Source/WTF/GNUmakefile.list.am	2013-01-17 09:58:56 UTC (rev 139973)
+++ trunk/Source/WTF/GNUmakefile.list.am	2013-01-17 10:04:45 UTC (rev 139974)
@@ -108,6 +108,8 @@
     Source/WTF/wtf/RAMSize.cpp \
     Source/WTF/wtf/RAMSize.h \
     Source/WTF/wtf/OSAllocator.h \
+    Source/WTF/wtf/OSAllocatorPosix.cpp \
+    Source/WTF/wtf/OSAllocatorWin.cpp \
     Source/WTF/wtf/OSRandomSource.cpp \
     Source/WTF/wtf/OSRandomSource.h \
     Source/WTF/wtf/OwnArrayPtr.h \
@@ -169,15 +171,18 @@
     Source/WTF/wtf/TCSystemAlloc.cpp \
     Source/WTF/wtf/TCSystemAlloc.h \
     Source/WTF/wtf/TemporaryChange.h \
+    Source/WTF/wtf/ThreadFunctionInvocation.h \
     Source/WTF/wtf/ThreadIdentifierDataPthreads.cpp \
     Source/WTF/wtf/ThreadIdentifierDataPthreads.h \
     Source/WTF/wtf/ThreadRestrictionVerifier.h \
     Source/WTF/wtf/ThreadSafeRefCounted.h \
     Source/WTF/wtf/ThreadSpecific.h \
+    Source/WTF/wtf/ThreadSpecificWin.cpp \
     Source/WTF/wtf/Threading.cpp \
     Source/WTF/wtf/Threading.h \
     Source/WTF/wtf/ThreadingPrimitives.h \
     Source/WTF/wtf/ThreadingPthreads.cpp \
+    Source/WTF/wtf/ThreadingWin.cpp \
     Source/WTF/wtf/TypeTraits.cpp \
     Source/WTF/wtf/TypeTraits.h \
     Source/WTF/wtf/TypedArrayBase.h \
@@ -249,40 +254,15 @@
     Source/WTF/wtf/unicode/CharacterNames.h \
     Source/WTF/wtf/unicode/Collator.h \
     Source/WTF/wtf/unicode/CollatorDefault.cpp \
+    Source/WTF/wtf/unicode/ScriptCodesFromICU.h \
     Source/WTF/wtf/unicode/UTF8.cpp \
     Source/WTF/wtf/unicode/UTF8.h \
     Source/WTF/wtf/unicode/Unicode.h \
-    Source/WTF/wtf/url/api/URLBuffer.h \
-    Source/WTF/wtf/url/api/URLQueryCharsetConverter.h
-
-if TARGET_WIN32
-wtf_sources += \
-    Source/WTF/wtf/OSAllocatorWin.cpp \
-    Source/WTF/wtf/ThreadFunctionInvocation.h \
-    Source/WTF/wtf/ThreadingWin.cpp \
-    Source/WTF/wtf/ThreadSpecificWin.cpp \
-    Source/WTF/wtf/win/OwnPtrWin.cpp
-else
-wtf_sources += \
-    Source/WTF/wtf/OSAllocatorPosix.cpp
-endif
-
-# ----
-# icu unicode backend
-# ----
-if USE_ICU_UNICODE
-wtf_sources += \
-    Source/WTF/wtf/unicode/icu/CollatorICU.cpp \
-    Source/WTF/wtf/unicode/icu/UnicodeIcu.h
-endif # USE_ICU_UNICODE
-
-# ----
-# glib unicode backend
-# ----
-if USE_GLIB_UNICODE
-wtf_sources += \
     Source/WTF/wtf/unicode/UnicodeMacrosFromICU.h \
-    Source/WTF/wtf/unicode/ScriptCodesFromICU.h \
     Source/WTF/wtf/unicode/glib/UnicodeGLib.h \
-    Source/WTF/wtf/unicode/glib/UnicodeGLib.cpp
-endif # USE_GLIB_UNICODE
+    Source/WTF/wtf/unicode/glib/UnicodeGLib.cpp \
+    Source/WTF/wtf/unicode/icu/CollatorICU.cpp \
+    Source/WTF/wtf/unicode/icu/UnicodeIcu.h \
+    Source/WTF/wtf/url/api/URLBuffer.h \
+    Source/WTF/wtf/url/api/URLQueryCharsetConverter.h \
+    Source/WTF/wtf/win/OwnPtrWin.cpp

Modified: trunk/Source/WTF/wtf/OSAllocatorPosix.cpp (139973 => 139974)


--- trunk/Source/WTF/wtf/OSAllocatorPosix.cpp	2013-01-17 09:58:56 UTC (rev 139973)
+++ trunk/Source/WTF/wtf/OSAllocatorPosix.cpp	2013-01-17 10:04:45 UTC (rev 139974)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "OSAllocator.h"
 
+#if OS(UNIX)
+
 #include "PageAllocation.h"
 #include <errno.h>
 #include <sys/mman.h>
@@ -187,3 +189,5 @@
 }
 
 } // namespace WTF
+
+#endif // OS(UNIX)

Modified: trunk/Source/WTF/wtf/OSAllocatorWin.cpp (139973 => 139974)


--- trunk/Source/WTF/wtf/OSAllocatorWin.cpp	2013-01-17 09:58:56 UTC (rev 139973)
+++ trunk/Source/WTF/wtf/OSAllocatorWin.cpp	2013-01-17 10:04:45 UTC (rev 139974)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "OSAllocator.h"
 
+#if OS(WINDOWS)
+
 #include "windows.h"
 #include <wtf/Assertions.h>
 
@@ -78,3 +80,5 @@
 }
 
 } // namespace WTF
+
+#endif // OS(WINDOWS)

Modified: trunk/Source/WTF/wtf/ThreadSpecificWin.cpp (139973 => 139974)


--- trunk/Source/WTF/wtf/ThreadSpecificWin.cpp	2013-01-17 09:58:56 UTC (rev 139973)
+++ trunk/Source/WTF/wtf/ThreadSpecificWin.cpp	2013-01-17 10:04:45 UTC (rev 139974)
@@ -22,6 +22,8 @@
 #include "config.h"
 #include "ThreadSpecific.h"
 
+#if OS(WINDOWS)
+
 #include "StdLibExtras.h"
 #include "ThreadingPrimitives.h"
 #include <wtf/DoublyLinkedList.h>
@@ -133,3 +135,5 @@
 } // namespace WTF
 
 #endif // !USE(PTHREADS)
+
+#endif // OS(WINDOWS)

Modified: trunk/Source/WTF/wtf/ThreadingWin.cpp (139973 => 139974)


--- trunk/Source/WTF/wtf/ThreadingWin.cpp	2013-01-17 09:58:56 UTC (rev 139973)
+++ trunk/Source/WTF/wtf/ThreadingWin.cpp	2013-01-17 10:04:45 UTC (rev 139974)
@@ -85,6 +85,9 @@
 
 #include "config.h"
 #include "Threading.h"
+
+#if OS(WINDOWS)
+
 #include "DateMath.h"
 #include "dtoa.h"
 #include "dtoa/cached-powers.h"
@@ -515,3 +518,5 @@
 }
 
 } // namespace WTF
+
+#endif // OS(WINDOWS)

Modified: trunk/Source/WTF/wtf/unicode/glib/UnicodeGLib.cpp (139973 => 139974)


--- trunk/Source/WTF/wtf/unicode/glib/UnicodeGLib.cpp	2013-01-17 09:58:56 UTC (rev 139973)
+++ trunk/Source/WTF/wtf/unicode/glib/UnicodeGLib.cpp	2013-01-17 10:04:45 UTC (rev 139974)
@@ -23,12 +23,15 @@
 #include "config.h"
 #include "UnicodeGLib.h"
 
+#if USE(GLIB_UNICODE)
+
 #include <wtf/Vector.h>
 #include <wtf/unicode/UTF8.h>
 
 #define UTF8_IS_SURROGATE(character) (character >= 0x10000 && character <= 0x10FFFF)
 
 namespace WTF {
+
 namespace Unicode {
 
 UChar32 foldCase(UChar32 ch)
@@ -189,5 +192,8 @@
     return g_utf8_collate(foldedA.get(), foldedB.get());
 }
 
-}
-}
+} // namespace Unicode
+
+} // namespace WTF
+
+#endif // USE(GLIB_UNICODE)

Modified: trunk/Source/WTF/wtf/unicode/glib/UnicodeGLib.h (139973 => 139974)


--- trunk/Source/WTF/wtf/unicode/glib/UnicodeGLib.h	2013-01-17 09:58:56 UTC (rev 139973)
+++ trunk/Source/WTF/wtf/unicode/glib/UnicodeGLib.h	2013-01-17 10:04:45 UTC (rev 139974)
@@ -25,6 +25,8 @@
 #ifndef UnicodeGLib_h
 #define UnicodeGLib_h
 
+#if USE(GLIB_UNICODE)
+
 #include <wtf/gobject/GOwnPtr.h>
 #include <wtf/unicode/ScriptCodesFromICU.h>
 #include <wtf/unicode/UnicodeMacrosFromICU.h>
@@ -39,6 +41,7 @@
 typedef int32_t UChar32;
 
 namespace WTF {
+
 namespace Unicode {
 
 enum Direction {
@@ -226,8 +229,10 @@
 
 int umemcasecmp(const UChar*, const UChar*, int len);
 
-}
-}
+} // namespace Unicode
 
-#endif
+} // namespace WTF
 
+#endif // USE(GLIB_UNICODE)
+
+#endif // UnicodeGlib_h

Modified: trunk/Source/WTF/wtf/unicode/icu/CollatorICU.cpp (139973 => 139974)


--- trunk/Source/WTF/wtf/unicode/icu/CollatorICU.cpp	2013-01-17 09:58:56 UTC (rev 139973)
+++ trunk/Source/WTF/wtf/unicode/icu/CollatorICU.cpp	2013-01-17 10:04:45 UTC (rev 139974)
@@ -148,6 +148,6 @@
     }
 }
 
-}
+} // namespace WTF
 
-#endif
+#endif // USE(ICU_UNICODE) && !UCONFIG_NO_COLLATION

Modified: trunk/Source/WTF/wtf/unicode/icu/UnicodeIcu.h (139973 => 139974)


--- trunk/Source/WTF/wtf/unicode/icu/UnicodeIcu.h	2013-01-17 09:58:56 UTC (rev 139973)
+++ trunk/Source/WTF/wtf/unicode/icu/UnicodeIcu.h	2013-01-17 10:04:45 UTC (rev 139974)
@@ -23,6 +23,8 @@
 #ifndef WTF_UNICODE_ICU_H
 #define WTF_UNICODE_ICU_H
 
+#if USE(ICU_UNICODE)
+
 #include <stdlib.h>
 #include <unicode/uchar.h>
 #include <unicode/uscript.h>
@@ -30,6 +32,7 @@
 #include <unicode/utf16.h>
 
 namespace WTF {
+
 namespace Unicode {
 
 enum Direction {
@@ -225,6 +228,10 @@
     return u_memcasecmp(a, b, len, U_FOLD_CASE_DEFAULT);
 }
 
-} }
+} // namespace Unicode
 
+} // namespace WTF
+
+#endif // USE(ICU_UNICODE)
+
 #endif // WTF_UNICODE_ICU_H

Modified: trunk/Source/WTF/wtf/win/OwnPtrWin.cpp (139973 => 139974)


--- trunk/Source/WTF/wtf/win/OwnPtrWin.cpp	2013-01-17 09:58:56 UTC (rev 139973)
+++ trunk/Source/WTF/wtf/win/OwnPtrWin.cpp	2013-01-17 10:04:45 UTC (rev 139974)
@@ -27,6 +27,8 @@
 #include "config.h"
 #include "OwnPtr.h"
 
+#if OS(WINDOWS)
+
 #include <windows.h>
 
 namespace WTF {
@@ -73,4 +75,6 @@
         DeleteObject(ptr);
 }
 
-}
+} // namespace WTF
+
+#endif // OS(WINDOWS)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to