summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1994-11-03 00:50:05 +0000
committerJim Meyering <jim@meyering.net>1994-11-03 00:50:05 +0000
commitcf2d9f220585b83d37d083a6ef64ab61649815e8 (patch)
tree5fc7b0c589188c27e1d81a4866aa5accf2f8b07d
parent63367c9b9cd595df2eba5b1cd54d25ba41e9160f (diff)
downloadgnulib-cf2d9f220585b83d37d083a6ef64ab61649815e8.tar.gz
GNU shell utilitiesSHELLUTILS-1_12
-rw-r--r--lib/getopt.c4
-rw-r--r--lib/getopt.h12
-rw-r--r--lib/getopt1.c4
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/getopt.c b/lib/getopt.c
index 964189d2dd..43c0a6a986 100644
--- a/lib/getopt.c
+++ b/lib/getopt.c
@@ -30,7 +30,7 @@
#include <config.h>
#endif
-#ifndef __STDC__
+#if !defined (__STDC__) || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
@@ -188,7 +188,7 @@ my_index (str, chr)
#ifdef __GNUC__
/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
That was relevant to code that was here before. */
-#ifndef __STDC__
+#if !defined (__STDC__) || !__STDC__
/* gcc with -traditional declares the built-in strlen to return int,
and has done so at least since version 2.4.5. -- rms. */
extern int strlen (const char *);
diff --git a/lib/getopt.h b/lib/getopt.h
index 45541f5ac0..4ac33b7182 100644
--- a/lib/getopt.h
+++ b/lib/getopt.h
@@ -1,5 +1,5 @@
/* Declarations for getopt.
- Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -76,7 +76,7 @@ extern int optopt;
struct option
{
-#if __STDC__
+#if defined (__STDC__) && __STDC__
const char *name;
#else
char *name;
@@ -94,15 +94,15 @@ struct option
#define required_argument 1
#define optional_argument 2
-#if __STDC__
-#if defined(__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__ */
extern int getopt ();
-#endif /* not __GNU_LIBRARY__ */
+#endif /* __GNU_LIBRARY__ */
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,
@@ -120,7 +120,7 @@ extern int getopt_long ();
extern int getopt_long_only ();
extern int _getopt_internal ();
-#endif /* not __STDC__ */
+#endif /* __STDC__ */
#ifdef __cplusplus
}
diff --git a/lib/getopt1.c b/lib/getopt1.c
index 725c653bbc..4580211cfa 100644
--- a/lib/getopt1.c
+++ b/lib/getopt1.c
@@ -1,5 +1,5 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
#include "getopt.h"
-#ifndef __STDC__
+#if !defined (__STDC__) || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const