bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH 06/14] stdlib: simplify preprocessor conditionals


From: Paul Eggert
Subject: [PATCH 06/14] stdlib: simplify preprocessor conditionals
Date: Mon, 4 Nov 2024 21:43:26 -0800

* lib/stdlib.in.h: Omit some redundant tests in conditionals.
---
 ChangeLog       | 3 +++
 lib/stdlib.in.h | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ccad8e84f6..c4c453a6c0 100644
--- 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
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 9d82f35b00..855038327e 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -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
-- 
2.43.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]