summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rwxr-xr-xconfigure23
-rw-r--r--lib.c5
-rw-r--r--parser.l4
-rw-r--r--stream.c5
-rw-r--r--utf8.c4
6 files changed, 38 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 4b9259ee..32199aa9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
2014-01-10 Kaz Kylheku <kaz@kylheku.com>
+ * configure: Detect platforms which don't reveal declarations
+ in C headers which are extensions to standard C, like popen or fileno,
+ in response to standard feature selection macros like -D_POSIX_SOURCE.
+ MinGW and Cygwin are offenders. These platforms hide the declarations
+ when gcc is in -ansi mode, by testing for __STRICT_ANSI__. Turns out,
+ however, that -U__STRICT_ANSI__ on the gcc command line strips this
+ away, causing the declarations to be revealed.
+
+ * lib.c, parser.l, stream.c, utf8.c: Removed the declarations which
+ compensated for the above problem. Yippee! Fuck you, stupid Cygwin
+ troglodytes, and the MinGW horse you rode in on.
+ http://cygwin.com/ml/cygwin/2011-10/msg00131.html
+
+2014-01-10 Kaz Kylheku <kaz@kylheku.com>
+
* eval.c (eval_init): Renaming lisp-parse to read; lisp-parse
is retained as an obsolescent synonym. All arguments become optional.
diff --git a/configure b/configure
index 337e2427..6574934e 100755
--- a/configure
+++ b/configure
@@ -709,6 +709,29 @@ done
printf "done\n"
#
+# Check for idiotic behavior: extensions in C header files controlled
+# by __STRICT_ANSI__ rather than things like __POSIX_SOURCE.
+#
+
+printf "Checking for proper support for feature-test macros ... "
+
+cat > conftest.c <<!
+#include <stdio.h>
+
+int main(void)
+{
+ return fileno(stdin);
+}
+!
+rm -f conftest$exe
+if ! $make EXTRA_FLAGS=-Werror conftest > conftest.err 2>&1 || ! [ -x conftest ] ; then
+ printf "no\n"
+ lang_flags="$lang_flags -U__STRICT_ANSI__"
+else
+ printf "yes\n"
+fi
+
+#
# Check for annoying warnings from ctype.h macros
#
diff --git a/lib.c b/lib.c
index 9662668b..5f046edf 100644
--- a/lib.c
+++ b/lib.c
@@ -60,11 +60,6 @@
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
-#if HAVE_WINDOWS_H
-int putenv(const char *);
-int tzset(void);
-#endif
-
#if !HAVE_POSIX_SIGS
int async_sig_enabled = 0;
#endif
diff --git a/parser.l b/parser.l
index 449fb236..0dca7331 100644
--- a/parser.l
+++ b/parser.l
@@ -50,10 +50,6 @@
#include "hash.h"
#include "parser.h"
-#if HAVE_WINDOWS_H
-int fileno(FILE *stream);
-#endif
-
#define YY_INPUT(buf, result, max_size) \
do { \
val c = get_byte(yyin_stream); \
diff --git a/stream.c b/stream.c
index 1ad75444..7ef91d5c 100644
--- a/stream.c
+++ b/stream.c
@@ -55,11 +55,6 @@
#include "stream.h"
#include "utf8.h"
-#if HAVE_WINDOWS_H
-int fileno(FILE *stream);
-int pclose(FILE *stream);
-#endif
-
val std_input, std_output, std_debug, std_error, std_null;
val output_produced;
diff --git a/utf8.c b/utf8.c
index c37e7d8d..36354277 100644
--- a/utf8.c
+++ b/utf8.c
@@ -36,10 +36,6 @@
#include "unwind.h"
#include "utf8.h"
-#if HAVE_WINDOWS_H
-FILE *popen(const char *path, const char *mode);
-#endif
-
#if WCHAR_MAX > 65535
#define FULL_UNICODE
#endif