Blame lib/getopt-pfx-ext.h

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