Title: [130039] trunk/Source/WTF
Revision
130039
Author
commit-qu...@webkit.org
Date
2012-10-01 05:28:45 -0700 (Mon, 01 Oct 2012)

Log Message

Check that __cplusplus is defined before comparing its value
https://bugs.webkit.org/show_bug.cgi?id=98015

Patch by Alberto Garcia <agar...@igalia.com> on 2012-10-01
Reviewed by Xan Lopez.

If __cplusplus is not defined is interpreted as having the value
0, but it produces a compilation warning with -Wundef.

This is the case with some API tests that are written in C
(JSNode.c, JSNodeList.c, minidom.c).

* wtf/Compiler.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (130038 => 130039)


--- trunk/Source/WTF/ChangeLog	2012-10-01 12:24:39 UTC (rev 130038)
+++ trunk/Source/WTF/ChangeLog	2012-10-01 12:28:45 UTC (rev 130039)
@@ -1,3 +1,18 @@
+2012-10-01  Alberto Garcia  <agar...@igalia.com>
+
+        Check that __cplusplus is defined before comparing its value
+        https://bugs.webkit.org/show_bug.cgi?id=98015
+
+        Reviewed by Xan Lopez.
+
+        If __cplusplus is not defined is interpreted as having the value
+        0, but it produces a compilation warning with -Wundef.
+
+        This is the case with some API tests that are written in C
+        (JSNode.c, JSNodeList.c, minidom.c).
+
+        * wtf/Compiler.h:
+
 2012-10-01  Carlos Garcia Campos  <cgar...@igalia.com>
 
         Unreviewed. Fix make distcheck.

Modified: trunk/Source/WTF/wtf/Compiler.h (130038 => 130039)


--- trunk/Source/WTF/wtf/Compiler.h	2012-10-01 12:24:39 UTC (rev 130038)
+++ trunk/Source/WTF/wtf/Compiler.h	2012-10-01 12:28:45 UTC (rev 130039)
@@ -122,7 +122,7 @@
 
 /* Specific compiler features */
 #if COMPILER(GCC) && !COMPILER(CLANG)
-#if GCC_VERSION_AT_LEAST(4, 7, 0) && __cplusplus >= 201103L
+#if GCC_VERSION_AT_LEAST(4, 7, 0) && defined(__cplusplus) && __cplusplus >= 201103L
 #define WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES 1
 #define WTF_COMPILER_SUPPORTS_CXX_DELETED_FUNCTIONS 1
 #define WTF_COMPILER_SUPPORTS_CXX_NULLPTR 1
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to