]> Savannah Git Hosting - gnulib.git/commitdiff
getopt-posix: Fix compilation error in C++ mode (regression 2024-09-21).
authorBruno Haible <bruno@clisp.org>
Mon, 23 Sep 2024 15:52:43 +0000 (17:52 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 1 Oct 2024 21:01:37 +0000 (23:01 +0200)
* lib/getopt-pfx-core.h: On AIX, HP-UX, Solaris, QNX, include <stdio.h>
first.

ChangeLog
lib/getopt-pfx-core.h

index 15a6910355828f0718f55e97e63337cee12762c6..8b822becc451880ca2a9a422d4616ec4bac85fc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-09-23  Bruno Haible  <bruno@clisp.org>
+
+       getopt-posix: Fix compilation error in C++ mode (regression 2024-09-21).
+       * lib/getopt-pfx-core.h: On AIX, HP-UX, Solaris, QNX, include <stdio.h>
+       first.
+
 2024-09-21  Bruno Haible  <bruno@clisp.org>
 
        getopt-posix, crypto/md5-buffer: Fix __GNUC_PREREQ re clang.
index 78b7816aa42aa5a7cacd0a383a002f861b674029..df2cb183a526456214575263d76b10b86b87673d 100644 (file)
    functions and variables.  Renaming avoids problems with some
    compilers and linkers.  */
 #ifdef __GETOPT_PREFIX
+
+/* Include platform-dependent header files that may declare getopt() and
+   friends.  */
+# if defined _AIX || defined __hpux || defined __sun || defined __QNX__
+#  include <stdio.h>
+# endif
+
 # ifndef __GETOPT_ID
 #  define __GETOPT_CONCAT(x, y) x ## y
 #  define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)