From 6ca0538dc7b9782d11e82ef22c21e9292f5a340a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 23 Sep 2024 17:52:43 +0200 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ lib/getopt-pfx-core.h | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 332d7ce5e9..c870d9dd1c 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-23 Bruno Haible jit/cache tests: Fix link error (regression 2024-09-20). 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) -- 2.39.5