Title: [141919] trunk/Source/WTF
Revision
141919
Author
[email protected]
Date
2013-02-05 12:58:23 -0800 (Tue, 05 Feb 2013)

Log Message

Rationalize the use of iOS/Mac #defines in Assertions.cpp
https://bugs.webkit.org/show_bug.cgi?id=108870

Patch by Benjamin Poulain <[email protected]> on 2013-02-05
Reviewed by David Kilzer.

* wtf/Assertions.cpp: Instead of using PLATFORM(MAC) and assume it works for iOS and OS X,
use CF as the guard for CFString. Similarily, USE_APPLE_SYSTEM_LOG guards code using ASL.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (141918 => 141919)


--- trunk/Source/WTF/ChangeLog	2013-02-05 20:52:36 UTC (rev 141918)
+++ trunk/Source/WTF/ChangeLog	2013-02-05 20:58:23 UTC (rev 141919)
@@ -1,5 +1,15 @@
 2013-02-05  Benjamin Poulain  <[email protected]>
 
+        Rationalize the use of iOS/Mac #defines in Assertions.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=108870
+
+        Reviewed by David Kilzer.
+
+        * wtf/Assertions.cpp: Instead of using PLATFORM(MAC) and assume it works for iOS and OS X,
+        use CF as the guard for CFString. Similarily, USE_APPLE_SYSTEM_LOG guards code using ASL.
+
+2013-02-05  Benjamin Poulain  <[email protected]>
+
         Make StringBuilder::toAtomicString() consistent with StringBuilder::toString() for strings of length zero
         https://bugs.webkit.org/show_bug.cgi?id=108894
 

Modified: trunk/Source/WTF/wtf/Assertions.cpp (141918 => 141919)


--- trunk/Source/WTF/wtf/Assertions.cpp	2013-02-05 20:52:36 UTC (rev 141918)
+++ trunk/Source/WTF/wtf/Assertions.cpp	2013-02-05 20:58:23 UTC (rev 141919)
@@ -45,10 +45,13 @@
 #include <signal.h>
 #endif
 
-#if PLATFORM(MAC)
+#if USE(CF)
 #include <CoreFoundation/CFString.h>
+#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
+#define WTF_USE_APPLE_SYSTEM_LOG 1
 #include <asl.h>
 #endif
+#endif // USE(CF)
 
 #if COMPILER(MSVC) && !OS(WINCE)
 #include <crtdbg.h>
@@ -77,7 +80,7 @@
 WTF_ATTRIBUTE_PRINTF(1, 0)
 static void vprintf_stderr_common(const char* format, va_list args)
 {
-#if PLATFORM(MAC)
+#if USE(CF) && !OS(WINDOWS)
     if (strstr(format, "%@")) {
         CFStringRef cfFormat = CFStringCreateWithCString(NULL, format, kCFStringEncodingUTF8);
 
@@ -94,7 +97,7 @@
 
         CFStringGetCString(str, buffer, length, kCFStringEncodingUTF8);
 
-#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
+#if USE(APPLE_SYSTEM_LOG)
         asl_log(0, 0, ASL_LEVEL_NOTICE, "%s", buffer);
 #endif
         fputs(buffer, stderr);
@@ -105,7 +108,7 @@
         return;
     }
 
-#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
+#if USE(APPLE_SYSTEM_LOG)
     va_list copyOfArgs;
     va_copy(copyOfArgs, args);
     asl_vlog(0, 0, ASL_LEVEL_NOTICE, format, copyOfArgs);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to