Blame gnulib/lib/getopt-pfx-core.h

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