Title: [114227] trunk/Source/WTF
Revision
114227
Author
tha...@chromium.org
Date
2012-04-16 00:14:28 -0700 (Mon, 16 Apr 2012)

Log Message

Make NullPtr.h compile with clang -std=c++11 and libstdc++4.2
https://bugs.webkit.org/show_bug.cgi?id=83999

Reviewed by Sam Weinig.

Before this patch, NullPtr.h assumed that a working |nullptr| implied
a working |std::nullptr_t| as well. With clang and libstdc++4.2, this
is not true.

I tested (-stdlib=libc++, -stdlib=libstdc++) x (-std=c++11, -std=c++03)
with clang.

* wtf/NullPtr.h:
(std):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (114226 => 114227)


--- trunk/Source/WTF/ChangeLog	2012-04-16 06:37:41 UTC (rev 114226)
+++ trunk/Source/WTF/ChangeLog	2012-04-16 07:14:28 UTC (rev 114227)
@@ -1,3 +1,20 @@
+2012-04-16  Nico Weber  <tha...@chromium.org>
+
+        Make NullPtr.h compile with clang -std=c++11 and libstdc++4.2
+        https://bugs.webkit.org/show_bug.cgi?id=83999
+
+        Reviewed by Sam Weinig.
+
+        Before this patch, NullPtr.h assumed that a working |nullptr| implied
+        a working |std::nullptr_t| as well. With clang and libstdc++4.2, this
+        is not true.
+
+        I tested (-stdlib=libc++, -stdlib=libstdc++) x (-std=c++11, -std=c++03)
+        with clang.
+
+        * wtf/NullPtr.h:
+        (std):
+
 2012-04-14  Sam Weinig  <s...@webkit.org>
 
         Harden WTF::ByteArray::create()

Modified: trunk/Source/WTF/wtf/NullPtr.h (114226 => 114227)


--- trunk/Source/WTF/wtf/NullPtr.h	2012-04-16 06:37:41 UTC (rev 114226)
+++ trunk/Source/WTF/wtf/NullPtr.h	2012-04-16 07:14:28 UTC (rev 114227)
@@ -37,12 +37,18 @@
 
 #include <cstddef>
 
+// libstdc++ supports nullptr_t starting with gcc 4.6.
+#if defined(__GLIBCXX__) && __GLIBCXX__ < 20110325
+namespace std {
+typedef decltype(nullptr) nullptr_t;
+}
+#endif
+
 #else
 
 namespace std {
-     class WTF_EXPORT_PRIVATE nullptr_t { };
+class WTF_EXPORT_PRIVATE nullptr_t { };
 }
-
 extern WTF_EXPORT_PRIVATE std::nullptr_t nullptr;
 
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to