Blame lib/getopt-pfx-ext.h

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