diff options
Diffstat (limited to 'gl/getopt-pfx-core.h')
| -rw-r--r-- | gl/getopt-pfx-core.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gl/getopt-pfx-core.h b/gl/getopt-pfx-core.h index 3a2fde5a..7c5ea094 100644 --- a/gl/getopt-pfx-core.h +++ b/gl/getopt-pfx-core.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* getopt (basic, portable features) gnulib wrapper header. | 1 | /* getopt (basic, portable features) gnulib wrapper header. |
| 2 | Copyright (C) 1989-2023 Free Software Foundation, Inc. | 2 | Copyright (C) 1989-2025 Free Software Foundation, Inc. |
| 3 | This file is part of gnulib. | 3 | This file is part of gnulib. |
| 4 | Unlike most of the getopt implementation, it is NOT shared | 4 | Unlike most of the getopt implementation, it is NOT shared |
| 5 | with the GNU C Library. | 5 | with the GNU C Library. |
| @@ -31,6 +31,16 @@ | |||
| 31 | functions and variables. Renaming avoids problems with some | 31 | functions and variables. Renaming avoids problems with some |
| 32 | compilers and linkers. */ | 32 | compilers and linkers. */ |
| 33 | #ifdef __GETOPT_PREFIX | 33 | #ifdef __GETOPT_PREFIX |
| 34 | |||
| 35 | /* Include platform-dependent header files that may declare getopt() and | ||
| 36 | friends. */ | ||
| 37 | # if defined _AIX || defined __hpux || defined __sun || defined __QNX__ | ||
| 38 | # include <stdio.h> | ||
| 39 | # endif | ||
| 40 | # if defined MUSL_LIBC || (defined __FreeBSD__ || defined __DragonFly__) || defined __NetBSD__ || defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined _AIX || defined __sun || defined __minix || defined __HAIKU__ | ||
| 41 | # include <unistd.h> | ||
| 42 | # endif | ||
| 43 | |||
| 34 | # ifndef __GETOPT_ID | 44 | # ifndef __GETOPT_ID |
| 35 | # define __GETOPT_CONCAT(x, y) x ## y | 45 | # define __GETOPT_CONCAT(x, y) x ## y |
| 36 | # define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) | 46 | # define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) |
| @@ -47,7 +57,7 @@ | |||
| 47 | # define optind __GETOPT_ID (optind) | 57 | # define optind __GETOPT_ID (optind) |
| 48 | # define optopt __GETOPT_ID (optopt) | 58 | # define optopt __GETOPT_ID (optopt) |
| 49 | 59 | ||
| 50 | /* Work around a a problem on macOS, which declares getopt with a | 60 | /* Work around a problem on macOS, which declares getopt with a |
| 51 | trailing __DARWIN_ALIAS(getopt) that would expand to something like | 61 | trailing __DARWIN_ALIAS(getopt) that would expand to something like |
| 52 | __asm("_" "rpl_getopt" "$UNIX2003") were it not for the following | 62 | __asm("_" "rpl_getopt" "$UNIX2003") were it not for the following |
| 53 | hack to suppress the macOS declaration <https://bugs.gnu.org/40205>. */ | 63 | hack to suppress the macOS declaration <https://bugs.gnu.org/40205>. */ |
