]> Savannah Git Hosting - gnulib.git/commitdiff
stdlib: Avoid syntax errors in libstdc++ header files on AIX.
authorCollin Funk <collin.funk1@gmail.com>
Sat, 12 Apr 2025 20:24:31 +0000 (13:24 -0700)
committerBruno Haible <bruno@clisp.org>
Mon, 14 Apr 2025 23:09:21 +0000 (01:09 +0200)
* lib/stdlib.in.h: Include <string> before strtol, strtoll, strtoul, or
strtoull gets defined as a macro.

ChangeLog
lib/stdlib.in.h

index e2b5042853d3621bbfb3ea3affd7bce0c7080d15..d729d7a3d352e1f4310f9fd3955759d51117c95e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-12  Collin Funk  <collin.funk1@gmail.com>
+
+       stdlib: Avoid syntax errors in libstdc++ header files on AIX.
+       * lib/stdlib.in.h: Include <string> before strtol, strtoll, strtoul, or
+       strtoull gets defined as a macro.
+
 2025-04-12  Bruno Haible  <bruno@clisp.org>
 
        fnmatch tests: Avoid test failures on macOS 15.4.
index 8233f6469bebf89e34da560a53f492a1ff062d78..a29b59bbe200eb78d78e4ac721d54bcd3dd7f778 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2024 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2025 Free Software Foundation, Inc.
 
    This file is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as
@@ -119,14 +119,14 @@ struct random_data
 # include <unistd.h>
 #endif
 
-#if ((@GNULIB_STRTOL@ && @REPLACE_STRTOL@) || (@GNULIB_STRTOLL@ && @REPLACE_STRTOLL@) || (@GNULIB_STRTOUL@ && @REPLACE_STRTOUL@) || (@GNULIB_STRTOULL@ && @REPLACE_STRTOULL@)) && defined __cplusplus && !defined GNULIB_NAMESPACE && defined __GNUG__ && !defined __clang__ && defined __sun
+#if ((@GNULIB_STRTOL@ && @REPLACE_STRTOL@) || (@GNULIB_STRTOLL@ && @REPLACE_STRTOLL@) || (@GNULIB_STRTOUL@ && @REPLACE_STRTOUL@) || (@GNULIB_STRTOULL@ && @REPLACE_STRTOULL@)) && defined __cplusplus && !defined GNULIB_NAMESPACE && defined __GNUG__ && !defined __clang__ && (defined __sun || defined _AIX)
 /* When strtol, strtoll, strtoul, or strtoull is going to be defined as a macro
    below, this may cause compilation errors later in the libstdc++ header files
    (that are part of GCC), such as:
      error: 'rpl_strtol' is not a member of 'std'
    To avoid this, include the relevant header files here, before these symbols
-   get defined as macros.  But do so only on Solaris 11 (where it is needed),
-   not on mingw (where it would cause other compilation errors).  */
+   get defined as macros.  But do so only on Solaris 11 and AIX (where it is
+   needed), not on mingw (where it would cause other compilation errors).  */
 # include <string>
 #endif