aboutsummaryrefslogtreecommitdiffstats
path: root/nonposix.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-04-07 22:00:09 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-04-07 22:00:09 +0300
commitd0cea7f12392a0f898dcd26472f1d7a26c71551d (patch)
tree8cc3f9fac3889f83bddc508871389673c3e1b885 /nonposix.h
parent62342b5ad8522da5cbc0623f2b645c48b31c2838 (diff)
parentb6fac528542ff95fa89e40a6a4c1da2a7346279b (diff)
downloadegawk-d0cea7f12392a0f898dcd26472f1d7a26c71551d.tar.gz
egawk-d0cea7f12392a0f898dcd26472f1d7a26c71551d.tar.bz2
egawk-d0cea7f12392a0f898dcd26472f1d7a26c71551d.zip
Merge branch 'master' into feature/cmake
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