aboutsummaryrefslogtreecommitdiff
blob: b397433c5c57cdf75c8a1e27744eb8cc8fcbd5ea (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
47
48
49
50
51
52
53
Declare the isatty prototype all the time ... otherwise packages like
doxygen and ttmkfdir fail to build.

http://bugs.gentoo.org/119598

--- flex/scan.c
+++ flex/scan.c
@@ -4179,9 +4179,19 @@
 	yyfree((void *) b  );
 }
 
+#ifndef _UNISTD_H /* assume unistd.h has isatty() for us */
-#ifndef __cplusplus
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __THROW /* this is a gnuism */
+extern int isatty (int ) __THROW;
+#else
 extern int isatty (int );
+#endif
-#endif /* __cplusplus */
+#ifdef __cplusplus
+}
+#endif
+#endif
     
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
--- flex/skel.c
+++ flex/skel.c
@@ -2183,9 +2183,19 @@
   "[[",
   "    m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],,",
   "    [[",
+  "#ifndef _UNISTD_H /* assume unistd.h has isatty() for us */",
-  "#ifndef __cplusplus",
+  "#ifdef __cplusplus",
+  "extern \"C\" {",
+  "#endif",
+  "#ifdef __THROW /* this is a gnuism */",
+  "extern int isatty M4_YY_PARAMS( int ) __THROW;",
+  "#else",
   "extern int isatty M4_YY_PARAMS( int );",
+  "#endif",
-  "#endif /* __cplusplus */",
+  "#ifdef __cplusplus",
+  "}",
+  "#endif",
+  "#endif",
   "    ]])",
   "]])",
   "%endif",