You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sys-devel/flex/files/flex-2.5.34-isatty.patch

54 lines
1.2 KiB

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",