aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-08-20 21:22:53 +0300
committerArnold D. Robbins <arnold@skeeve.com>2013-08-20 21:22:53 +0300
commit445f13a1e5eff0b0f520118fd89db7fe0a7b0aa8 (patch)
tree4467b3b8a1397fb585aa3b47a4b8aa61710e5acd
parentf209a8dc1991803899d815a1be12da803e852e00 (diff)
parent844e16cea1ffe0e02b5b727fd8960271d1842020 (diff)
downloadegawk-445f13a1e5eff0b0f520118fd89db7fe0a7b0aa8.tar.gz
egawk-445f13a1e5eff0b0f520118fd89db7fe0a7b0aa8.tar.bz2
egawk-445f13a1e5eff0b0f520118fd89db7fe0a7b0aa8.zip
Merge branch 'gawk-4.1-stable'
-rw-r--r--ChangeLog8
-rw-r--r--Makefile.am1
-rw-r--r--Makefile.in1
-rw-r--r--awk.h8
-rw-r--r--extension/ChangeLog4
-rw-r--r--extension/gawkdirfd.h10
-rw-r--r--nonposix.h31
7 files changed, 53 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e385f81..5f6450b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-08-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * nonposix.h: New file. Contains FAKE_FD_VALUE.
+ * awk.h: Include it if MinGW or EMX.
+ * Makefile.am (base_sources): Add nonposix.h.
+
2013-08-18 Arnold D. Robbins <arnold@skeeve.com>
Reflect updates to ENVIRON into the real environment.
@@ -8,7 +14,7 @@
New functions.
(env_array_func): New array vtable.
- Unrelated:
+2013-08-18 Arnold D. Robbins <arnold@skeeve.com>
* array.c (force_array): Set symbol->xarray to NULL before
initing the array if it was Node_var_new.
diff --git a/Makefile.am b/Makefile.am
index 8d977d75..f9968c6d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -113,6 +113,7 @@ base_sources = \
mpfr.c \
msg.c \
node.c \
+ nonposix.h \
profile.c \
protos.h \
random.c \
diff --git a/Makefile.in b/Makefile.in
index ff055c14..9a1a9053 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -489,6 +489,7 @@ base_sources = \
mpfr.c \
msg.c \
node.c \
+ nonposix.h \
profile.c \
protos.h \
random.c \
diff --git a/awk.h b/awk.h
index 50631982..1f84b5a6 100644
--- a/awk.h
+++ b/awk.h
@@ -206,11 +206,9 @@ typedef void *stackoverflow_context_t;
#define stackoverflow_install_handler(catchstackoverflow, extra_stack, STACK_SIZE) 0
#endif
-/*
- * This is for fake directory file descriptors on systems that don't
- * allow to open() a directory.
- */
-#define FAKE_FD_VALUE 42
+#if defined(__EMX__) || defined(__MINGW32__)
+#include "nonposix.h"
+#endif /* defined(__EMX__) || defined(__MINGW32__) */
/* use this as lintwarn("...")
this is a hack but it gives us the right semantics */
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 97c3f40e..d7e8e588 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,7 @@
+2013-08-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkdirfd.h: Include ../nonposix.h to get FAKE_FD_VALUE.
+
2013-08-06 Arnold D. Robbins <arnold@skeeve.com>
* filefuncs.c: Change _WIN32 to __MINGW32__ globally, per
diff --git a/extension/gawkdirfd.h b/extension/gawkdirfd.h
index 4710dab4..a3a2b6a6 100644
--- a/extension/gawkdirfd.h
+++ b/extension/gawkdirfd.h
@@ -29,11 +29,13 @@
* This is for fake directory file descriptors on systems that don't
* allow to open() a directory.
*
- * It would be nice if this could be shared with the definition in awk.h
- * in the main code base, but there's not a very clean way to do that,
- * at least that I can see.
+ * Including a header from the main gawk source to share the definition
+ * of FAKE_FD_VALUE is the least of all evils that I can see.
+ *
+ * Unlike the main gawk code base, this include is NOT dependant
+ * upon MinGW or EMX.
*/
-#define FAKE_FD_VALUE 42
+#include "../nonposix.h"
#ifndef DIR_TO_FD
# define DIR_TO_FD(d) (FAKE_FD_VALUE)
diff --git a/nonposix.h b/nonposix.h
new file mode 100644
index 00000000..88fd9e69
--- /dev/null
+++ b/nonposix.h
@@ -0,0 +1,31 @@
+/*
+ * nonposix.h --- definitions needed on non-POSIX systems.
+ */
+
+/*
+ * Copyright (C) 2012, 2013 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * This is for fake directory file descriptors on systems that don't
+ * allow to open() a directory.
+ */
+
+#define FAKE_FD_VALUE 42