Blame lib/getopt-pfx-ext.h

Packit Service c30d13
/* getopt (GNU extensions) gnulib wrapper header.
Packit Service c30d13
   Copyright (C) 1989-2018 Free Software Foundation, Inc.
Packit Service c30d13
   This file is part of gnulib.
Packit Service c30d13
   Unlike most of the getopt implementation, it is NOT shared
Packit Service c30d13
   with the GNU C Library.
Packit Service c30d13
Packit Service c30d13
   This file is free software; you can redistribute it and/or modify it
Packit Service c30d13
   under the terms of the GNU General Public License as
Packit Service c30d13
   published by the Free Software Foundation; either version 3 of
Packit Service c30d13
   the License, or (at your option) any later version.
Packit Service c30d13
Packit Service c30d13
   This file is distributed in the hope that it will be useful, but
Packit Service c30d13
   WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service c30d13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service c30d13
   General Public License for more details.
Packit Service c30d13
Packit Service c30d13
   You should have received a copy of the GNU General Public
Packit Service c30d13
   License along with gnulib; if not, see
Packit Service c30d13
   <https://www.gnu.org/licenses/>.  */
Packit Service c30d13
Packit Service c30d13
#ifndef _GETOPT_PFX_EXT_H
Packit Service c30d13
#define _GETOPT_PFX_EXT_H 1
Packit Service c30d13
Packit Service c30d13
/* This header should not be used directly; include getopt.h instead.
Packit Service c30d13
   It does not have a protective #error, because the guard macro for
Packit Service c30d13
   getopt.h in gnulib is not fixed.  */
Packit Service c30d13
Packit Service c30d13
/* Standalone applications should #define __GETOPT_PREFIX to an
Packit Service c30d13
   identifier that prefixes the external functions and variables
Packit Service c30d13
   defined in getopt-core.h and getopt-ext.h.  Systematically
Packit Service c30d13
   rename identifiers so that they do not collide with the system
Packit Service c30d13
   functions and variables.  Renaming avoids problems with some
Packit Service c30d13
   compilers and linkers.  */
Packit Service c30d13
#ifdef __GETOPT_PREFIX
Packit Service c30d13
# ifndef __GETOPT_ID
Packit Service c30d13
#  define __GETOPT_CONCAT(x, y) x ## y
Packit Service c30d13
#  define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
Packit Service c30d13
#  define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
Packit Service c30d13
# endif
Packit Service c30d13
# undef getopt_long
Packit Service c30d13
# undef getopt_long_only
Packit Service c30d13
# undef option
Packit Service c30d13
# undef _getopt_internal
Packit Service c30d13
# define getopt_long __GETOPT_ID (getopt_long)
Packit Service c30d13
# define getopt_long_only __GETOPT_ID (getopt_long_only)
Packit Service c30d13
# define option __GETOPT_ID (option)
Packit Service c30d13
# define _getopt_internal __GETOPT_ID (getopt_internal)
Packit Service c30d13
Packit Service c30d13
/* The system's getopt.h may have already included getopt-ext.h to
Packit Service c30d13
   declare the unprefixed identifiers.  Undef _GETOPT_EXT_H so that
Packit Service c30d13
   getopt-ext.h declares them with prefixes.  */
Packit Service c30d13
# undef _GETOPT_EXT_H
Packit Service c30d13
#endif
Packit Service c30d13
Packit Service c30d13
/* Standalone applications get correct prototypes for getopt_long and
Packit Service c30d13
   getopt_long_only; they declare "char **argv".  For backward
Packit Service c30d13
   compatibility with old applications, if __GETOPT_PREFIX is not
Packit Service c30d13
   defined, we supply GNU-libc-compatible, but incorrect, prototypes
Packit Service c30d13
   using "char *const *argv".  (GNU libc is stuck with the incorrect
Packit Service c30d13
   prototypes, as they are baked into older versions of LSB.)  */
Packit Service c30d13
#ifndef __getopt_argv_const
Packit Service c30d13
# if defined __GETOPT_PREFIX
Packit Service c30d13
#  define __getopt_argv_const /* empty */
Packit Service c30d13
# else
Packit Service c30d13
#  define __getopt_argv_const const
Packit Service c30d13
# endif
Packit Service c30d13
#endif
Packit Service c30d13
Packit Service c30d13
#include <getopt-ext.h>
Packit Service c30d13
Packit Service c30d13
#endif /* _GETOPT_PFX_EXT_H */