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):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114227
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-04-16 Nico Weber <thakis@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 <sam@webkit.org>
Harden WTF::ByteArray::create()
#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