summaryrefslogtreecommitdiff
blob: 2231531569c744dae53a46d991395637c0bde863 (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 @@
 
 #ifndef YY_ALWAYS_INTERACTIVE
 #ifndef 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 YY_PARAMS(( int )) __THROW;
+#else
 extern int isatty YY_PARAMS(( int ));
+#endif
-#endif /* __cplusplus */
+#ifdef __cplusplus
+}
+#endif
+#endif
 #endif /* !YY_NEVER_INTERACTIVE */
 #endif /* !YY_ALWAYS_INTERACTIVE */
 
--- 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",