CMake: Use CMAKE_THREAD_LIBS_INIT in liblzma.pc only with pthreads
[xz/debian.git] / lib / getopt-pfx-ext.h
blob00d2a0952f45ab65e7901c2626e7430476df5845
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
3 /* getopt (GNU extensions) gnulib wrapper header.
4 Copyright (C) 1989-2023 Free Software Foundation, Inc.
5 This file is part of gnulib.
6 Unlike most of the getopt implementation, it is NOT shared
7 with the GNU C Library.
9 This file is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2.1 of the
12 License, or (at your option) any later version.
14 This file is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public License
20 along with this program. If not, see <https://www.gnu.org/licenses/>. */
22 #ifndef _GETOPT_PFX_EXT_H
23 #define _GETOPT_PFX_EXT_H 1
25 /* This header should not be used directly; include getopt.h instead.
26 It does not have a protective #error, because the guard macro for
27 getopt.h in gnulib is not fixed. */
29 /* Standalone applications should #define __GETOPT_PREFIX to an
30 identifier that prefixes the external functions and variables
31 defined in getopt-core.h and getopt-ext.h. Systematically
32 rename identifiers so that they do not collide with the system
33 functions and variables. Renaming avoids problems with some
34 compilers and linkers. */
35 #ifdef __GETOPT_PREFIX
36 # ifndef __GETOPT_ID
37 # define __GETOPT_CONCAT(x, y) x ## y
38 # define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
39 # define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
40 # endif
41 # undef getopt_long
42 # undef getopt_long_only
43 # undef option
44 # undef _getopt_internal
45 # define getopt_long __GETOPT_ID (getopt_long)
46 # define getopt_long_only __GETOPT_ID (getopt_long_only)
47 # define option __GETOPT_ID (option)
48 # define _getopt_internal __GETOPT_ID (getopt_internal)
50 /* The system's getopt.h may have already included getopt-ext.h to
51 declare the unprefixed identifiers. Undef _GETOPT_EXT_H so that
52 getopt-ext.h declares them with prefixes. */
53 # undef _GETOPT_EXT_H
54 #endif
56 /* Standalone applications get correct prototypes for getopt_long and
57 getopt_long_only; they declare "char **argv". For backward
58 compatibility with old applications, if __GETOPT_PREFIX is not
59 defined, we supply GNU-libc-compatible, but incorrect, prototypes
60 using "char *const *argv". (GNU libc is stuck with the incorrect
61 prototypes, as they are baked into older versions of LSB.) */
62 #ifndef __getopt_argv_const
63 # if defined __GETOPT_PREFIX
64 # define __getopt_argv_const /* empty */
65 # else
66 # define __getopt_argv_const const
67 # endif
68 #endif
70 #include <getopt-ext.h>
72 #endif /* _GETOPT_PFX_EXT_H */