]> Savannah Git Hosting - gnulib.git/commitdiff
stdlib: simplify preprocessor conditionals
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Nov 2024 06:02:28 +0000 (22:02 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 5 Nov 2024 05:40:18 +0000 (21:40 -0800)
* lib/stdlib.in.h: Omit some redundant tests in conditionals.

ChangeLog
lib/stdlib.in.h

index ccad8e84f6245cc4c76cbf8b200696c11f2dc297..c4c453a6c0704f014dcba6ad8736622a4cf79682 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2024-11-04  Paul Eggert  <eggert@cs.ucla.edu>
 
+       stdlib: simplify preprocessor conditionals
+       * lib/stdlib.in.h: Omit some redundant tests in conditionals.
+
        realloc: don’t require success for nongrowth
        * lib/realloc.c (rpl_realloc): Do not require realloc (p, 0) to
        succeed, as apparently glibc realloc (p, n) can sometimes fail
index 9d82f35b005abf562757b7d1335e4abd8b7a55ad..855038327e2d9ac00aa6c10c1ad35e48680f4fe2 100644 (file)
@@ -367,7 +367,7 @@ _GL_WARN_ON_USE (atoll, "atoll is unportable - "
 #endif
 
 #if @GNULIB_CALLOC_POSIX@
-# if (@GNULIB_CALLOC_POSIX@ && @REPLACE_CALLOC_FOR_CALLOC_POSIX@) \
+# if @REPLACE_CALLOC_FOR_CALLOC_POSIX@ \
      || (@GNULIB_CALLOC_GNU@ && @REPLACE_CALLOC_FOR_CALLOC_GNU@)
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef calloc
@@ -681,7 +681,7 @@ _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
    by never specifying a zero size), so it does not need malloc or
    realloc to be redefined.  */
 #if @GNULIB_MALLOC_POSIX@
-# if (@GNULIB_MALLOC_POSIX@ && @REPLACE_MALLOC_FOR_MALLOC_POSIX@) \
+# if @REPLACE_MALLOC_FOR_MALLOC_POSIX@ \
      || (@GNULIB_MALLOC_GNU@ && @REPLACE_MALLOC_FOR_MALLOC_GNU@)
 #  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
         || _GL_USE_STDLIB_ALLOC)
@@ -1454,7 +1454,7 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
 
 
 #if @GNULIB_REALLOC_POSIX@
-# if (@GNULIB_REALLOC_POSIX@ && @REPLACE_REALLOC_FOR_REALLOC_POSIX@)
+# if @REPLACE_REALLOC_FOR_REALLOC_POSIX@
 #  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
         || _GL_USE_STDLIB_ALLOC)
 #   undef realloc