From 024a7f06979b467299a85e915b78af456a89e3a6 Mon Sep 17 00:00:00 2001 From: paul Date: Sun, 15 May 2005 14:25:08 +0000 Subject: 2005-05-15 Paul Jakma * getopt.h: It's not just __GNU_LIBRARY__ which defines getopt, eg __EXTENSIONS__ does too on SunOS. It still seems awfully fragile though. * getopt.c: include zebra.h after config.h, before including getopt.h so that things at least are consistent.. * getopt1.c: ditto --- lib/ChangeLog | 9 +++++++++ lib/getopt.c | 2 ++ lib/getopt.h | 4 ++-- lib/getopt1.c | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 18ac2214..5a0eff55 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,12 @@ +2005-05-15 Paul Jakma + + * getopt.h: It's not just __GNU_LIBRARY__ which defines + getopt, eg __EXTENSIONS__ does too on SunOS. It still seems + awfully fragile though. + * getopt.c: include zebra.h after config.h, before including + getopt.h so that things at least are consistent.. + * getopt1.c: ditto + 2005-05-07 Yar Tikhiy * sockopt.c: Add support for BSD style ifindex in ip_mreq. diff --git a/lib/getopt.c b/lib/getopt.c index 426b29bf..329e9395 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -34,6 +34,8 @@ # include #endif +#include + #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ diff --git a/lib/getopt.h b/lib/getopt.h index c4519b7f..68a9acfb 100644 --- a/lib/getopt.h +++ b/lib/getopt.h @@ -99,12 +99,12 @@ struct option #define optional_argument 2 #if defined (__STDC__) && __STDC__ -#ifdef __GNU_LIBRARY__ +#if defined (__GNU_LIBRARY__) || defined (__EXTENSIONS__) /* 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__ or __EXTENSIONS__ */ extern int getopt (void); #endif /* __GNU_LIBRARY__ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, diff --git a/lib/getopt1.c b/lib/getopt1.c index ff257374..985f12c5 100644 --- a/lib/getopt1.c +++ b/lib/getopt1.c @@ -24,6 +24,7 @@ #include #endif +#include #include "getopt.h" #if !defined __STDC__ || !__STDC__ -- cgit v1.2.1