Add gperf 3.0.1.
[dragonfly.git] / contrib / gperf-3.0.1 / lib / getopt.h.patch
1 getopt.h is a modified version of the getopt.h found in the glibc snapshot
2 on 1998-04-14. Below the patch that has been applied to this file. The glibc
3 maintainer has been informed of these patches.
4
5 diff -c3 getopt.h.orig getopt.h
6 *** getopt.h.orig       Sat Jun 21 03:01:53 1997
7 --- getopt.h    Mon Aug 28 12:36:27 2000
8 ***************
9 *** 1,5 ****
10   /* Declarations for getopt.
11 !    Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
12      This file is part of the GNU C Library.
13   
14      The GNU C Library is free software; you can redistribute it and/or
15 --- 1,5 ----
16   /* Declarations for getopt.
17 !    Copyright (C) 1989-1998, 2000 Free Software Foundation, Inc.
18      This file is part of the GNU C Library.
19   
20      The GNU C Library is free software; you can redistribute it and/or
21 ***************
22 *** 78,84 ****
23   
24   struct option
25   {
26 ! #if defined (__STDC__) && __STDC__
27     const char *name;
28   #else
29     char *name;
30 --- 78,84 ----
31   
32   struct option
33   {
34 ! #if (defined (__STDC__) && __STDC__) || defined (__cplusplus)
35     const char *name;
36   #else
37     char *name;
38 ***************
39 *** 96,102 ****
40   #define required_argument     1
41   #define optional_argument     2
42   
43 ! #if defined (__STDC__) && __STDC__
44   #ifdef __GNU_LIBRARY__
45   /* Many other libraries have conflicting prototypes for getopt, with
46      differences in the consts, in stdlib.h.  To avoid compilation
47 --- 96,108 ----
48   #define required_argument     1
49   #define optional_argument     2
50   
51 ! #if (defined (__STDC__) && __STDC__) || defined (__cplusplus)
52 ! #ifdef __cplusplus
53 ! /* SunOS4 declares getopt with the following prototype:
54 !    extern int getopt (int argc, const char *const *argv, const char *shortopts);
55 !    We cannot redeclare it when compiling C++ code. */
56 ! #define getopt(x,y,z) getopt_long(x, y, z, (const struct option *) 0, (int *) 0)
57 ! #else /* not __cplusplus */
58   #ifdef __GNU_LIBRARY__
59   /* Many other libraries have conflicting prototypes for getopt, with
60      differences in the consts, in stdlib.h.  To avoid compilation
61 ***************
62 *** 105,110 ****
63 --- 111,117 ----
64   #else /* not __GNU_LIBRARY__ */
65   extern int getopt ();
66   #endif /* __GNU_LIBRARY__ */
67 + #endif /* __cplusplus */
68   extern int getopt_long (int argc, char *const *argv, const char *shortopts,
69                         const struct option *longopts, int *longind);
70   extern int getopt_long_only (int argc, char *const *argv,