Blame lib/getopt-pfx-core.h

Packit 8f70b4
/* getopt (basic, portable features) gnulib wrapper header.
Packit 8f70b4
   Copyright (C) 1989-2018 Free Software Foundation, Inc.
Packit 8f70b4
   This file is part of gnulib.
Packit 8f70b4
   Unlike most of the getopt implementation, it is NOT shared
Packit 8f70b4
   with the GNU C Library.
Packit 8f70b4
Packit 8f70b4
   This file is free software; you can redistribute it and/or modify it
Packit 8f70b4
   under the terms of the GNU General Public License as
Packit 8f70b4
   published by the Free Software Foundation; either version 3 of
Packit 8f70b4
   the License, or (at your option) any later version.
Packit 8f70b4
Packit 8f70b4
   This file is distributed in the hope that it will be useful, but
Packit 8f70b4
   WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 8f70b4
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 8f70b4
   General Public License for more details.
Packit 8f70b4
Packit 8f70b4
   You should have received a copy of the GNU General Public
Packit 8f70b4
   License along with gnulib; if not, see
Packit 8f70b4
   <https://www.gnu.org/licenses/>.  */
Packit 8f70b4
Packit 8f70b4
#ifndef _GETOPT_PFX_CORE_H
Packit 8f70b4
#define _GETOPT_PFX_CORE_H 1
Packit 8f70b4
Packit 8f70b4
/* This header should not be used directly; include getopt.h or
Packit 8f70b4
   unistd.h instead.  It does not have a protective #error, because
Packit 8f70b4
   the guard macro for getopt.h in gnulib is not fixed.  */
Packit 8f70b4
Packit 8f70b4
/* Standalone applications should #define __GETOPT_PREFIX to an
Packit 8f70b4
   identifier that prefixes the external functions and variables
Packit 8f70b4
   defined in getopt-core.h and getopt-ext.h.  Systematically
Packit 8f70b4
   rename identifiers so that they do not collide with the system
Packit 8f70b4
   functions and variables.  Renaming avoids problems with some
Packit 8f70b4
   compilers and linkers.  */
Packit 8f70b4
#ifdef __GETOPT_PREFIX
Packit 8f70b4
# ifndef __GETOPT_ID
Packit 8f70b4
#  define __GETOPT_CONCAT(x, y) x ## y
Packit 8f70b4
#  define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
Packit 8f70b4
#  define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
Packit 8f70b4
# endif
Packit 8f70b4
# undef getopt
Packit 8f70b4
# undef optarg
Packit 8f70b4
# undef opterr
Packit 8f70b4
# undef optind
Packit 8f70b4
# undef optopt
Packit 8f70b4
# define getopt __GETOPT_ID (getopt)
Packit 8f70b4
# define optarg __GETOPT_ID (optarg)
Packit 8f70b4
# define opterr __GETOPT_ID (opterr)
Packit 8f70b4
# define optind __GETOPT_ID (optind)
Packit 8f70b4
# define optopt __GETOPT_ID (optopt)
Packit 8f70b4
Packit 8f70b4
/* The system's getopt.h may have already included getopt-core.h to
Packit 8f70b4
   declare the unprefixed identifiers.  Undef _GETOPT_CORE_H so that
Packit 8f70b4
   getopt-core.h declares them with prefixes.  */
Packit 8f70b4
# undef _GETOPT_CORE_H
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
#include <getopt-core.h>
Packit 8f70b4
Packit 8f70b4
#endif /* _GETOPT_PFX_CORE_H */