[glib/c-cxx-std-versions: 3/7] gmacros: Define NULL ass nullptr with C++11 and onwards if not defined




commit 881796e56b5f25fbfc6dd06fe68d4f97e8f64d2f
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 6251afae5f..6b64747ecc 100644
--- a/glib/gmacros.h
+++ b/glib/gmacros.h
@@ -892,7 +892,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]