From 1d82398e9feec224ddb64763001b9d66cd269e83 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 21 Nov 2004 05:10:10 +0000 Subject: [PATCH] (__CONCAT): New macro. (getopt, getopt_long, getopt_long_only, optarg, opterr, optind, optopt): Use it instead of invoking ## directly; otherwise, the symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt. --- lib/getopt_.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/getopt_.h b/lib/getopt_.h index 6eaa7eb91a..30c2bf2068 100644 --- a/lib/getopt_.h +++ b/lib/getopt_.h @@ -44,13 +44,16 @@ # undef opterr # undef optind # undef optopt -# define getopt __GETOPT_PREFIX##getopt -# define getopt_long __GETOPT_PREFIX##getopt_long -# define getopt_long_only __GETOPT_PREFIX##getopt_long_only -# define optarg __GETOPT_PREFIX##optarg -# define opterr __GETOPT_PREFIX##opterr -# define optind __GETOPT_PREFIX##optind -# define optopt __GETOPT_PREFIX##optopt +# ifndef __CONCAT +# define __CONCAT(x, y) x ## y +# endif +# define getopt __CONCAT (__GETOPT_PREFIX, getopt) +# define getopt_long __CONCAT (__GETOPT_PREFIX, getopt_long) +# define getopt_long_only __CONCAT (__GETOPT_PREFIX, getopt_long_only) +# define optarg __CONCAT (__GETOPT_PREFIX, optarg) +# define opterr __CONCAT (__GETOPT_PREFIX, opterr) +# define optind __CONCAT (__GETOPT_PREFIX, optind) +# define optopt __CONCAT (__GETOPT_PREFIX, optopt) #endif /* Standalone applications get correct prototypes for getopt_long and -- 2.30.2