]> Savannah Git Hosting - gnulib.git/commitdiff
nullptr: rename from c-nullptr
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 7 Feb 2023 22:30:54 +0000 (14:30 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 7 Feb 2023 23:14:10 +0000 (15:14 -0800)
* NEWS, doc/gnulib.texi: Mention this.
* m4/nullptr.m4: Rename from m4/c-nullptr.m4.
(gl_NULLPTR): Rename from gl_C_NULLPTR.
* modules/nullptr: Rename from modules/nullptr.
* modules/nullptr-c++-tests: Rename from modules/c-nullptr-c++-tests.
* modules/nullptr-tests: Rename from modules/c-nullptr-tests.
All uses changed.

ChangeLog
NEWS
doc/gnulib.texi
m4/c-nullptr.m4 [deleted file]
m4/nullptr.m4 [new file with mode: 0644]
modules/c-nullptr [deleted file]
modules/c-nullptr-c++-tests [deleted file]
modules/c-nullptr-tests [deleted file]
modules/nullptr [new file with mode: 0644]
modules/nullptr-c++-tests [new file with mode: 0644]
modules/nullptr-tests [new file with mode: 0644]

index b6eec570beb13508769d01171b8fd238eac01fa0..defcef16e3fc34115afd66dc2d0fea8c960ac8b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-02-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+       nullptr: rename from c-nullptr
+       * NEWS, doc/gnulib.texi: Mention this.
+       * m4/nullptr.m4: Rename from m4/c-nullptr.m4.
+       (gl_NULLPTR): Rename from gl_C_NULLPTR.
+       * modules/nullptr: Rename from modules/nullptr.
+       * modules/nullptr-c++-tests: Rename from modules/c-nullptr-c++-tests.
+       * modules/nullptr-tests: Rename from modules/c-nullptr-tests.
+       All uses changed.
+
 2023-02-07  Bruno Haible  <bruno@clisp.org>
 
        Fix a copyright header - module license mismatch.
diff --git a/NEWS b/NEWS
index f3b508f95084a6307656192fc7ce4fdde4678ed6..0ec377915c9912ca480148c8b3d12bd90e27a266 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -74,6 +74,8 @@ User visible incompatible changes
 
 Date        Modules         Changes
 
+2023-02-07  c-nullptr       Rename this module to nullptr.
+
 2023-01-21  getprogname     The include file is changed from "getprogname.h"
                             to <stdlib.h>.
 
index b3f011818c60c28be407ade45c715335388cf108..6fe2678834348c0c74737b7d6694e0d9b922149c 100644 (file)
@@ -920,13 +920,13 @@ On pre-C23 platforms, the keyword substitutes assume C99 or later.
 @node nullptr
 @section @code{nullptr}
 
-Gnulib module: c-nullptr
+Gnulib module: nullptr
 
 @cindex null pointer
-The @code{c-nullptr} module arranges for @code{nullptr} to act
-like standard C@.
+The @code{nullptr} module arranges for @code{nullptr} to act
+like standard C and C++.
 
-The @code{nullptr} keyword yields a null pointer.  It differs from
+The @code{nullptr} keyword yields a null pointer.  It differs from
 the @code{NULL} macro, in that @code{NULL} might be an integer whereas
 @code{nullptr} is of a special @code{nullptr_t} type with only one
 value, namely @code{nullptr} itself.  Using @code{nullptr} can help
@@ -939,7 +939,8 @@ Portability problems fixed by Gnulib:
 @itemize
 @item
 Some platforms lack @code{nullptr}:
-GCC 12, Clang 15, and other pre-2023 C compilers.
+For C: GCC 12, Clang 15, and other pre-2023 C compilers.
+For C++: pre-2011 C++ compilers.
 @end itemize
 
 Portability problems not fixed by Gnulib:
diff --git a/m4/c-nullptr.m4 b/m4/c-nullptr.m4
deleted file mode 100644 (file)
index 960eeff..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-# Check for nullptr that conforms to C23.
-
-dnl Copyright 2023 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_C_NULLPTR],
-[
-  AC_CACHE_CHECK([for nullptr], [gl_cv_c_nullptr],
-    [AC_COMPILE_IFELSE(
-       [AC_LANG_SOURCE([[int *p = nullptr;]])],
-       [gl_cv_c_nullptr=yes],
-       [gl_cv_c_nullptr=no])])
-  if test "$gl_cv_c_nullptr" = yes; then
-    AC_DEFINE([HAVE_C_NULLPTR], [1], [Define to 1 if nullptr works.])
-  fi
-])
-
-  AH_VERBATIM([nullptr],
-[#ifndef nullptr /* keep config.h idempotent */
-# ifdef __cplusplus
-/* For the C++ compiler the result of the configure test is irrelevant.
-   We know that at least g++ and clang with option -std=c++11 or higher, as well
-   as MSVC 14 or newer, already have nullptr.  */
-#  if !(((defined __GNUC__ || defined __clang__) && __cplusplus >= 201103L) \
-        || (defined _MSC_VER && 1900 <= _MSC_VER))
-/* Define nullptr as a macro, the best we can.  */
-#   if 3 <= __GNUG__
-#    define nullptr __null
-#   else
-#    define nullptr 0L
-#   endif
-#  endif
-# else
-/* For the C compiler, use the result of the configure test.  */
-#  ifndef HAVE_C_NULLPTR
-#   define nullptr ((void *) 0)
-#  endif
-# endif
-#endif])
-])
diff --git a/m4/nullptr.m4 b/m4/nullptr.m4
new file mode 100644 (file)
index 0000000..e1218cc
--- /dev/null
@@ -0,0 +1,42 @@
+# Check for nullptr that conforms to C23.
+
+dnl Copyright 2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_NULLPTR],
+[
+  AC_CACHE_CHECK([for nullptr], [gl_cv_c_nullptr],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_SOURCE([[int *p = nullptr;]])],
+       [gl_cv_c_nullptr=yes],
+       [gl_cv_c_nullptr=no])])
+  if test "$gl_cv_c_nullptr" = yes; then
+    AC_DEFINE([HAVE_C_NULLPTR], [1], [Define to 1 if nullptr works.])
+  fi
+])
+
+  AH_VERBATIM([nullptr],
+[#ifndef nullptr /* keep config.h idempotent */
+# ifdef __cplusplus
+/* For the C++ compiler the result of the configure test is irrelevant.
+   We know that at least g++ and clang with option -std=c++11 or higher, as well
+   as MSVC 14 or newer, already have nullptr.  */
+#  if !(((defined __GNUC__ || defined __clang__) && __cplusplus >= 201103L) \
+        || (defined _MSC_VER && 1900 <= _MSC_VER))
+/* Define nullptr as a macro, the best we can.  */
+#   if 3 <= __GNUG__
+#    define nullptr __null
+#   else
+#    define nullptr 0L
+#   endif
+#  endif
+# else
+/* For the C compiler, use the result of the configure test.  */
+#  ifndef HAVE_C_NULLPTR
+#   define nullptr ((void *) 0)
+#  endif
+# endif
+#endif])
+])
diff --git a/modules/c-nullptr b/modules/c-nullptr
deleted file mode 100644 (file)
index bc5fa43..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-Description:
-A nullptr that is like C23.
-
-Files:
-m4/c-nullptr.m4
-
-Depends-on:
-
-configure.ac:
-gl_C_NULLPTR
-
-Makefile.am:
-
-Include:
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/c-nullptr-c++-tests b/modules/c-nullptr-c++-tests
deleted file mode 100644 (file)
index ae60f4b..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-Files:
-tests/test-nullptr-c++.cc
-
-Status:
-c++-test
-
-Depends-on:
-ansi-c++-opt
-
-configure.ac:
-
-Makefile.am:
-if ANSICXX
-TESTS += test-nullptr-c++
-check_PROGRAMS += test-nullptr-c++
-test_nullptr_c___SOURCES = test-nullptr-c++.cc
-endif
diff --git a/modules/c-nullptr-tests b/modules/c-nullptr-tests
deleted file mode 100644 (file)
index 40e28d2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Files:
-tests/test-nullptr.c
-tests/macros.h
-
-Depends-on:
-c-nullptr-c++-tests
-
-configure.ac:
-
-Makefile.am:
-TESTS += test-nullptr
-check_PROGRAMS += test-nullptr
diff --git a/modules/nullptr b/modules/nullptr
new file mode 100644 (file)
index 0000000..4133085
--- /dev/null
@@ -0,0 +1,20 @@
+Description:
+A nullptr that is like C23.
+
+Files:
+m4/nullptr.m4
+
+Depends-on:
+
+configure.ac:
+gl_NULLPTR
+
+Makefile.am:
+
+Include:
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/nullptr-c++-tests b/modules/nullptr-c++-tests
new file mode 100644 (file)
index 0000000..ae60f4b
--- /dev/null
@@ -0,0 +1,17 @@
+Files:
+tests/test-nullptr-c++.cc
+
+Status:
+c++-test
+
+Depends-on:
+ansi-c++-opt
+
+configure.ac:
+
+Makefile.am:
+if ANSICXX
+TESTS += test-nullptr-c++
+check_PROGRAMS += test-nullptr-c++
+test_nullptr_c___SOURCES = test-nullptr-c++.cc
+endif
diff --git a/modules/nullptr-tests b/modules/nullptr-tests
new file mode 100644 (file)
index 0000000..21a7caf
--- /dev/null
@@ -0,0 +1,12 @@
+Files:
+tests/test-nullptr.c
+tests/macros.h
+
+Depends-on:
+nullptr-c++-tests
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-nullptr
+check_PROGRAMS += test-nullptr