[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] getopt?
From: |
Paul Eggert |
Subject: |
Re: [Bug-gnulib] getopt? |
Date: |
Sat, 20 Nov 2004 23:22:55 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Following up to my own email, I had a brain cramp with the previous
checkin (a common circumstance whenever I use ##). I installed
the following patch instead.
2004-11-20 Paul Eggert <address@hidden>
* getopt_.h (__GETOPT_CONCAT, __GETOPT_XCONCAT, __GETOPT_ID):
New macros.
(getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
optopt): Use them instead of invoking ## directly; otherwise, the
symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
Index: getopt_.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/getopt_.h,v
retrieving revision 1.5
retrieving revision 1.7
diff -p -u -r1.5 -r1.7
--- getopt_.h 17 Nov 2004 01:53:27 -0000 1.5
+++ getopt_.h 21 Nov 2004 07:22:02 -0000 1.7
@@ -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
+# define __GETOPT_CONCAT(x, y) x ## y
+# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
+# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
+# define getopt __GETOPT_ID (getopt)
+# define getopt_long __GETOPT_ID (getopt_long)
+# define getopt_long_only __GETOPT_ID (getopt_long_only)
+# define optarg __GETOPT_ID (optarg)
+# define opterr __GETOPT_ID (opterr)
+# define optind __GETOPT_ID (optind)
+# define optopt __GETOPT_ID (optopt)
#endif
/* Standalone applications get correct prototypes for getopt_long and