summary refs log tree commit diff
path: root/posix/getopt.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-09-11 12:14:37 +0000
committerUlrich Drepper <drepper@redhat.com>1998-09-11 12:14:37 +0000
commit04795ad9025b5f7891eb746fa6f29d1251d2c0b5 (patch)
tree40686d38e2842b7537b699dfb0655b0dfdfd6881 /posix/getopt.h
parent5e0889da396b35ef7d57d43dca6f09899e4c8d66 (diff)
downloadglibc-04795ad9025b5f7891eb746fa6f29d1251d2c0b5.tar.gz
glibc-04795ad9025b5f7891eb746fa6f29d1251d2c0b5.tar.xz
glibc-04795ad9025b5f7891eb746fa6f29d1251d2c0b5.zip
Update.
1998-09-11  Ulrich Drepper  <drepper@cygnus.com>

	* resolv/res_init.c (res_init): Handle resolv.conf file with only
	one nameserver correctly.  Patch by HJ Lu.

	* iconvdata/Makefile (modules): Add IEC_P27-1, BALTIC, ASMO_449,
	and ANSI_X3.110.
	Define *-routines variables for new modules.
	(distribute): Add .c files for new modules.
	(awk-generated-headers): Add iec_p27-1.h, baltic.h, and asmo_449.h.
	Add rules for hedaer generation.
	* iconvdata/gconv-modules: Add entries for new modules.  Pretty print.
	* iconvdata/ansi_x3.110.c: New file.
	* iconvdata/asmo_449.c: New file.
	* iconvdata/baltic.c: New file.
	* iconvdata/iec_p27-1.c: New file.

	* iconvdata/t61.c (from_ucs4): Correct 0x23, 0x24, 0x80, and 0x81
	entries.
	Convert U02dc correctly.

	* math/atest-exp.c: Add parentheses to avoid gcc warnings.
	* math/atest-exp2.c: Likewise.
	* math/atest-sincos.c: Likewise.

	* posix/getopt.h: Don't define non-POSIX stuff unless _GNU_SOURCE
	is defined.

1998-09-11 10:51  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* string/strcoll.c: Optimize a few expressions.
	* string/strxfrm.c: Likewise.
Diffstat (limited to 'posix/getopt.h')
-rw-r--r--posix/getopt.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/posix/getopt.h b/posix/getopt.h
index 68958c10bc..c9414373a5 100644
--- a/posix/getopt.h
+++ b/posix/getopt.h
@@ -1,5 +1,5 @@
 /* Declarations for getopt.
-   Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
+   Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -55,6 +55,7 @@ extern int opterr;
 
 extern int optopt;
 
+#ifdef _GNU_SOURCE
 /* Describe the long-named options requested by the application.
    The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
    of `struct option' terminated by an element containing a name which is
@@ -78,11 +79,11 @@ extern int optopt;
 
 struct option
 {
-#if defined (__STDC__) && __STDC__
+# if defined __STDC__ && __STDC__
   const char *name;
-#else
+# else
   char *name;
-#endif
+# endif
   /* has_arg can't be an enum because some compilers complain about
      type mismatches in all the code that assumes it is an int.  */
   int has_arg;
@@ -92,19 +93,23 @@ struct option
 
 /* Names for the values of the `has_arg' field of `struct option'.  */
 
-#define	no_argument		0
-#define required_argument	1
-#define optional_argument	2
+# define no_argument		0
+# define required_argument	1
+# define optional_argument	2
+#endif	/* GNU source */
+
 
-#if defined (__STDC__) && __STDC__
-#ifdef __GNU_LIBRARY__
+#if defined __STDC__ && __STDC__
+# ifdef __GNU_LIBRARY__
 /* Many other libraries have conflicting prototypes for getopt, with
    differences in the consts, in stdlib.h.  To avoid compilation
    errors, only prototype getopt for the GNU C library.  */
 extern int getopt (int argc, char *const *argv, const char *shortopts);
-#else /* not __GNU_LIBRARY__ */
+# else /* not __GNU_LIBRARY__ */
 extern int getopt ();
-#endif /* __GNU_LIBRARY__ */
+# endif /* __GNU_LIBRARY__ */
+
+# ifdef _GNU_SOURCE
 extern int getopt_long (int argc, char *const *argv, const char *shortopts,
 		        const struct option *longopts, int *longind);
 extern int getopt_long_only (int argc, char *const *argv,
@@ -116,12 +121,15 @@ extern int _getopt_internal (int argc, char *const *argv,
 			     const char *shortopts,
 		             const struct option *longopts, int *longind,
 			     int long_only);
+# endif
 #else /* not __STDC__ */
 extern int getopt ();
+# ifdef _GNU_SOURCE
 extern int getopt_long ();
 extern int getopt_long_only ();
 
 extern int _getopt_internal ();
+# endif
 #endif /* __STDC__ */
 
 #ifdef	__cplusplus