From 62e312ead808cec055049592b0d40aa3a8882bc9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 27 Oct 2017 09:29:20 -0600 Subject: [PATCH] Use NULL instead of polyfill, if nullptr is not available Part of fixing https://github.com/behdad/harfbuzz/issues/585 --- src/hb-private.hh | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/hb-private.hh b/src/hb-private.hh index 268a2b0a8..a6b3ab8ca 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -80,25 +80,9 @@ extern "C" void hb_free_impl(void *ptr); #if __cplusplus < 201103L -// Null pointer literal -// Source: SC22/WG21/N2431 = J16/07-0301 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf - -const // this is a const object... -class { -public: - template // convertible to any type - operator T*() const { // of null non-member - return 0; // pointer... - } - template // or any type of null - operator T C::*() const { // member pointer... - return 0; - } -private: - void operator&() const; // whose address can't be taken -} _hb_nullptr = {}; // and whose name is nullptr -#define nullptr _hb_nullptr +#ifndef nullptr +#define nullptr NULL +#endif // Static assertions #ifndef static_assert