[glib/atomic-older-cplusplus: 9/10] gmacros: Define NULL ass nullptr with C++11 and onwards if not defined




commit a882bcaa535973824b6ddc4a985c9708cdcc6fbf
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Wed Sep 14 01:37:11 2022 +0200

    gmacros: Define NULL ass nullptr with C++11 and onwards if not defined

 glib/gmacros.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/glib/gmacros.h b/glib/gmacros.h
index 5903860cec..af117f48e6 100644
--- a/glib/gmacros.h
+++ b/glib/gmacros.h
@@ -889,7 +889,9 @@
  *  defined then the current definition is correct.
  */
 #ifndef NULL
-#  ifdef G_CXX_STD_VERSION
+#  if G_CXX_STD_CHECK_VERSION (11)
+#  define NULL        (nullptr)
+#  elif G_CXX_STD_VERSION
 #  define NULL        (0L)
 #  else /* !G_CXX_STD_VERSION */
 #  define NULL        ((void*) 0)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]