summaryrefslogtreecommitdiff
path: root/Build/source/libs/obsdcompat
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-02-22 12:09:38 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-02-22 12:09:38 +0000
commitb287d7f6a13823ea17e0bd415981d3a5953ca703 (patch)
treea420b28a35f7761f064d50bb610dbb2b46c71486 /Build/source/libs/obsdcompat
parent5fd6fd3479fcbbda52ebca7b5e80a5aaa1add69f (diff)
build system: various small fixes for mingw32 cross compilation
still incomplete git-svn-id: svn://tug.org/texlive/trunk@17141 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/obsdcompat')
-rw-r--r--Build/source/libs/obsdcompat/ChangeLog5
-rw-r--r--Build/source/libs/obsdcompat/includes.h14
2 files changed, 19 insertions, 0 deletions
diff --git a/Build/source/libs/obsdcompat/ChangeLog b/Build/source/libs/obsdcompat/ChangeLog
index d7a2bd06abd..22b95a1bed4 100644
--- a/Build/source/libs/obsdcompat/ChangeLog
+++ b/Build/source/libs/obsdcompat/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-20 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * includes.h [__MINGW32__]: Temporarily #define eof as macro
+ while #including <fcntl.h>.
+
2009-05-09 Peter Breitenlohner <peb@mppmu.mpg.de>
* configure.ac: Don't check LLONG_MAX twice, otherwise may use
diff --git a/Build/source/libs/obsdcompat/includes.h b/Build/source/libs/obsdcompat/includes.h
index 32e2b64c2e2..2a3b1539ab5 100644
--- a/Build/source/libs/obsdcompat/includes.h
+++ b/Build/source/libs/obsdcompat/includes.h
@@ -34,7 +34,21 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg }
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
+#ifdef __MINGW32__
+/* In mingw32, the eof() function is part of the !_NO_OLDNAMES section
+ of <io.h>, that is read in automatically via <fcntl.h>. We cannot
+ allow that because web2c/lib/eofeoln.c defines a private,
+ incompatible function named eof().
+ But many of the other things defined via !_NO_OLDNAMES are needed,
+ so #define _NO_OLDNAMES cannot be used. So, temporarily define eof
+ as a macro.
+*/
+#define eof saved_eof
#include <fcntl.h> /* For O_NONBLOCK */
+#undef eof
+#else
+#include <fcntl.h> /* For O_NONBLOCK */
+#endif
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>