summaryrefslogtreecommitdiff
path: root/gnulib-local/lib/getopt-core.h.diff
blob: 5e385cf7d32f66cad47d11785038441539521505 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- getopt-core.h.bak	2020-06-26 21:24:59.890340657 +0200
+++ getopt-core.h	2020-07-28 19:48:27.769014629 +0200
@@ -20,6 +20,14 @@
 #ifndef _GETOPT_CORE_H
 #define _GETOPT_CORE_H 1
 
+/* Ensure that DLL_VARIABLE is defined.  Since on OSF/1 4.0 and Irix 6.5
+   <stdlib.h> includes <getopt.h>, and <config.h> is not a prerequisite for
+   using <stdlib.h>, this file can be included without a prior
+   "#include <config.h>".  */
+#if !defined DLL_VARIABLE && defined HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 /* This header should not be used directly; include getopt.h or
    unistd.h instead.  Unlike most bits headers, it does not have
    a protective #error, because the guard macro for getopt.h in
@@ -33,7 +41,7 @@
    Also, when 'ordering' is RETURN_IN_ORDER,
    each non-option ARGV-element is returned here.  */
 
-extern char *optarg;
+extern DLL_VARIABLE char *optarg;
 
 /* Index in ARGV of the next element to be scanned.
    This is used for communication to and from the caller
@@ -47,16 +55,16 @@
    Otherwise, 'optind' communicates from one call to the next
    how much of ARGV has been scanned so far.  */
 
-extern int optind;
+extern DLL_VARIABLE int optind;
 
 /* Callers store zero here to inhibit the error message 'getopt' prints
    for unrecognized options.  */
 
-extern int opterr;
+extern DLL_VARIABLE int opterr;
 
 /* Set to an option character which was unrecognized.  */
 
-extern int optopt;
+extern DLL_VARIABLE int optopt;
 
 /* Get definitions and prototypes for functions to process the
    arguments in ARGV (ARGC of them, minus the program name) for