aboutsummaryrefslogtreecommitdiffstats
path: root/nonposix.h
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2016-04-07 19:43:07 +0300
committerEli Zaretskii <eliz@gnu.org>2016-04-07 19:43:07 +0300
commit82dec6932ed868d9466d23ac5956e09594707dd2 (patch)
tree9e3791ac45ac303018ef8507769d39e475720662 /nonposix.h
parent1b5d1b8870cb0ac1c4b99f6cf67e3277427df864 (diff)
downloadegawk-82dec6932ed868d9466d23ac5956e09594707dd2.tar.gz
egawk-82dec6932ed868d9466d23ac5956e09594707dd2.tar.bz2
egawk-82dec6932ed868d9466d23ac5956e09594707dd2.zip
Fix the MinGW compilation.
Diffstat (limited to 'nonposix.h')
-rw-r--r--nonposix.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/nonposix.h b/nonposix.h
index 88fd9e69..976e0b7d 100644
--- a/nonposix.h
+++ b/nonposix.h
@@ -29,3 +29,18 @@
*/
#define FAKE_FD_VALUE 42
+
+#ifdef __MINGW32__
+/* Replacements for sys/wait.h macros. */
+# define WEXITSTATUS(stv) (((unsigned)(stv)) & ~0xC0000000)
+/* MS-Windows programs that crash due to a fatal exception exit with
+ an exit code whose 2 MSB bits are set. */
+# define WIFEXITED(stv) ((((unsigned)(stv)) & 0xC0000000) == 0)
+# define WIFSIGNALED(stv) ((((unsigned)(stv)) & 0xC0000000) == 0xC0000000)
+# define WTERMSIG(stv) w32_status_to_termsig ((unsigned)stv)
+# define WIFSTOPPED(stv) (0)
+# define WSTOPSIG(stv) (0)
+
+int w32_status_to_termsig (unsigned);
+
+#endif