[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS shishi/gl
From: |
shishi-commit |
Subject: |
CVS shishi/gl |
Date: |
Mon, 29 Nov 2004 02:55:42 +0100 |
Update of /home/cvs/shishi/gl
In directory dopio:/tmp/cvs-serv3215/gl
Modified Files:
getopt_.h
Log Message:
Update.
--- /home/cvs/shishi/gl/getopt_.h 2004/11/21 18:04:14 1.5
+++ /home/cvs/shishi/gl/getopt_.h 2004/11/29 01:55:42 1.6
@@ -37,6 +37,7 @@
# if HAVE_UNISTD_H
# include <unistd.h>
# endif
+# undef __need_getopt
# undef getopt
# undef getopt_long
# undef getopt_long_only
@@ -60,11 +61,24 @@
getopt_long_only; they declare "char **argv". libc uses prototypes
with "char *const *argv" that are incorrect because getopt_long and
getopt_long_only can permute argv; this is required for backward
- compatibility (e.g., for LSB 2.0.1). */
-#if defined __GETOPT_PREFIX && !defined __need_getopt
-# define __getopt_argv_const /* empty */
-#else
-# define __getopt_argv_const const
+ compatibility (e.g., for LSB 2.0.1).
+
+ This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt',
+ but it caused redefinition warnings if both unistd.h and getopt.h were
+ included, since unistd.h includes getopt.h having previously defined
+ __need_getopt.
+
+ The only place where __getopt_argv_const is used is in definitions
+ of getopt_long and getopt_long_only below, but these are visible
+ only if __need_getopt is not defined, so it is quite safe to rewrite
+ the conditional as follows:
+*/
+#if !defined __need_getopt
+# if defined __GETOPT_PREFIX
+# define __getopt_argv_const /* empty */
+# else
+# define __getopt_argv_const const
+# endif
#endif
/* If __GNU_LIBRARY__ is not already defined, either we are being used
- CVS shishi/gl, (continued)
- CVS shishi/gl, shishi-commit, 2004/11/10
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/12
- CVS shishi/gl, shishi-commit, 2004/11/19
- CVS shishi/gl, shishi-commit, 2004/11/19
- CVS shishi/gl, shishi-commit, 2004/11/21
- CVS shishi/gl,
shishi-commit <=