From: Bruno Haible Date: Mon, 23 Sep 2024 15:52:43 +0000 (+0200) Subject: getopt-posix: Fix compilation error in C++ mode (regression 2024-09-21). X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=1ce8b14f90a8e135f3260cc1f71d8b5f67432b3f;p=gnulib.git getopt-posix: Fix compilation error in C++ mode (regression 2024-09-21). * lib/getopt-pfx-core.h: On AIX, HP-UX, Solaris, QNX, include first. --- diff --git a/ChangeLog b/ChangeLog index 15a6910355..8b822becc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-09-23 Bruno Haible + + getopt-posix: Fix compilation error in C++ mode (regression 2024-09-21). + * lib/getopt-pfx-core.h: On AIX, HP-UX, Solaris, QNX, include + first. + 2024-09-21 Bruno Haible getopt-posix, crypto/md5-buffer: Fix __GNUC_PREREQ re clang. diff --git a/lib/getopt-pfx-core.h b/lib/getopt-pfx-core.h index 78b7816aa4..df2cb183a5 100644 --- a/lib/getopt-pfx-core.h +++ b/lib/getopt-pfx-core.h @@ -31,6 +31,13 @@ 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 +# endif + # ifndef __GETOPT_ID # define __GETOPT_CONCAT(x, y) x ## y # define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)