From d614d6afe521fe08f14206c38b8532956134e108 Mon Sep 17 00:00:00 2001 From: Mitch Capper Date: Fri, 29 Nov 2024 02:28:47 -0800 Subject: [PATCH] Patch updates, for gawk remove all incl build-aux files --- build/f_gawk_build.sh | 1 + patches/repo_diffutils.patch | 33 +- patches/repo_gawk.patch | 574 +++++++++++++++++------------------ 3 files changed, 278 insertions(+), 330 deletions(-) diff --git a/build/f_gawk_build.sh b/build/f_gawk_build.sh index 295360a..98f951e 100644 --- a/build/f_gawk_build.sh +++ b/build/f_gawk_build.sh @@ -29,6 +29,7 @@ fi cp gnulib/build-aux/bootstrap.conf . echo "gnulib_tool_option_extras=\" --without-tests --symlink --m4-base=m4 --lib=libgawk --source-base=lib --cache-modules\"" >> bootstrap.conf git mv m4 m4_orig + git rm build-aux/* mkdir -p m4 mkdir -p pc/old mv pc/* pc/old/ || true diff --git a/patches/repo_diffutils.patch b/patches/repo_diffutils.patch index bff6419..6507b54 100644 --- a/patches/repo_diffutils.patch +++ b/patches/repo_diffutils.patch @@ -1,30 +1,9 @@ -diff --git a/gl/lib/mcel.h b/gl/lib/mcel.h -index 867d925..0813496 100644 ---- a/gl/lib/mcel.h -+++ b/gl/lib/mcel.h -@@ -159,14 +159,14 @@ mcel_ch (char32_t ch, size_t len) - assume (0 < len); - assume (len <= MCEL_LEN_MAX); - assume (ch <= MCEL_CHAR_MAX); -- return (mcel_t) {ch: ch, len: len}; -+ return (mcel_t) {.ch = ch, .len = len}; - } - MCEL_INLINE mcel_t - mcel_err (unsigned char err) - { - assume (MCEL_ERR_MIN <= err); - assume (err <= MCEL_ERR_MAX); -- return (mcel_t) {err: err, len: 1}; -+ return (mcel_t) {.err = err, .len = 1}; - } - - /* Compare C1 and C2, with encoding errors sorting after characters. diff --git a/src/system.h b/src/system.h -index 7a7e914..8e8b980 100644 +index 7bc778b..50777f8 100644 --- a/src/system.h +++ b/src/system.h @@ -29,6 +29,12 @@ - #include + #include #include #include +#ifdef _WIN32 @@ -34,13 +13,13 @@ index 7a7e914..8e8b980 100644 +#endif +#endif - #ifndef STAT_BLOCKSIZE - # if HAVE_STRUCT_STAT_ST_BLKSIZE + #include + diff --git a/src/util.c b/src/util.c -index db3ceba..ad65f2b 100644 +index 6c65991..e14e260 100644 --- a/src/util.c +++ b/src/util.c -@@ -281,7 +281,9 @@ process_signals (void) +@@ -283,7 +283,9 @@ process_signals (void) if (stops) { stop_signal_count = stops - 1; diff --git a/patches/repo_gawk.patch b/patches/repo_gawk.patch index b3d0fcf..9ead2dc 100644 --- a/patches/repo_gawk.patch +++ b/patches/repo_gawk.patch @@ -166,24 +166,9 @@ index cfe250c3..050ed4fe 100644 +#endif return 0; } -diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh -index 2a50d7f6..7cf8f107 100644 ---- a/build-aux/ltmain.sh -+++ b/build-aux/ltmain.sh -@@ -3109,9 +3109,8 @@ func_convert_core_msys_to_w32 () - { - $debug_cmd - -- # awkward: cmd appends spaces to result -- func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | -- $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` -+func_convert_core_msys_to_w32_result=$1 -+ - } - #end: func_convert_core_msys_to_w32 diff --git a/builtin.c b/builtin.c -index c887b3ce..943307f1 100644 +index c887b3ce..fe9e9c66 100644 --- a/builtin.c +++ b/builtin.c @@ -23,13 +23,24 @@ @@ -228,6 +213,15 @@ index c887b3ce..943307f1 100644 extern NODE **args_array; extern int max_args; +@@ -3314,7 +3325,7 @@ do_mkbool(int nargs) + int + gawk_system(const char *command) + { +-#if defined(VMS) || defined(__MINGW32__) ++#if defined(VMS) || defined(__MINGW32__) || defined(_WIN32) + return system(command); + #else /* ! (defined(VMS) || defined(__MINGW32__)) */ + pid_t childpid; diff --git a/configure.ac b/configure.ac index ae95b69a..f53295e6 100644 --- a/configure.ac @@ -858,7 +852,7 @@ index 447210cb..da94b02e 100644 #include "awk.h" diff --git a/io.c b/io.c -index b0af38b5..192e3fa0 100644 +index b0af38b5..47586799 100644 --- a/io.c +++ b/io.c @@ -23,6 +23,12 @@ @@ -1009,41 +1003,15 @@ index b0af38b5..192e3fa0 100644 *path = '\0'; else strcpy(path, pi->awkpath[i]); -@@ -4597,7 +4621,7 @@ avoid_flush(const char *name) - return in_PROCINFO(bufferpipe, NULL, NULL) != NULL - || in_PROCINFO(name, bufferpipe, NULL) != NULL; - } -- -+#ifdef _WIN32 - /* - * See the thread starting at - * https://lists.gnu.org/archive/html/bug-gawk/2023-12/msg00011.html. -@@ -4628,8 +4652,10 @@ gawk_popen_write(const char *cmd) - return NULL; - - if (open_pipes == NULL) { -- int count = getdtablesize(); -- -+ quoted commands is to remove the first and the last quote -+ characters, and leave the rest (including any quote characters -+ inside the outer pair) intact. */ -+ sprintf(quoted, "\"%s\"", cmd); - emalloc(open_pipes, write_pipe *, sizeof(write_pipe) * count, - "gawk_popen_write"); - memset(open_pipes, 0, sizeof(write_pipe) * count); -@@ -4663,10 +4689,9 @@ gawk_popen_write(const char *cmd) - open_pipes[index].pid = childpid; - open_pipes[index].fp = fp; - -- return fp; +@@ -4666,7 +4690,6 @@ gawk_popen_write(const char *cmd) + return fp; #endif } - -+static SOCKET valid_socket(int fd) /* gawk_popen_write_close --- close a FILE * that we created */ static int -@@ -4698,3 +4723,33 @@ gawk_popen_write_close(FILE *fp) +@@ -4698,3 +4721,33 @@ gawk_popen_write_close(FILE *fp) return -1; #endif } @@ -1446,263 +1414,263 @@ index 00000000..08108b21 --- /dev/null +++ b/osfixes.h @@ -0,0 +1,257 @@ -+//shared between bash and gawk -+#pragma once -+#ifdef _WIN32 -+#include "config.h" -+//with newer windows sdks the wrong header order in some files results in a SocketNotificationRetrieveEvents defined multiple times error, this is the easiest solution ive seen -+#ifndef WINSOCK_INCLUDED -+#define WINSOCK_INCLUDED 1 -+#include -+#include -+#endif -+ -+ -+ -+#define TTYSTRUCT struct ttyjunked -+ -+ -+#define TIOCHPCL _IO('t', 2) /* hang up on last close */ -+#define TIOCGETP _IOR('t', 8,TTYSTRUCT)/* get parameters -- gtty */ -+#define TIOCSETP _IOW('t', 9,TTYSTRUCT)/* set parameters -- stty */ -+#define TIOCSETN _IOW('t',10,TTYSTRUCT)/* as above, but no flushtty*/ -+#define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */ -+#define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */ -+#define TANDEM 0x00000001 /* send stopc on out q full */ -+#define CBREAK 0x00000002 /* half-cooked mode */ -+#define LCASE 0x00000004 /* simulate lower case */ -+#define ECHO 0x00000008 /* enable echoing */ -+#define CRMOD 0x00000010 /* map \r to \r\n on output */ -+#define RAW 0x00000020 /* no i/o processing */ -+#define ODDP 0x00000040 /* get/send odd parity */ -+#define EVENP 0x00000080 /* get/send even parity */ -+#define ANYP 0x000000c0 /* get any parity/send none */ -+#define NLDELAY 0x00000300 /* \n delay */ -+#define NL0 0x00000000 -+#define NL1 0x00000100 /* tty 37 */ -+#define NL2 0x00000200 /* vt05 */ -+#define NL3 0x00000300 -+#define TBDELAY 0x00000c00 /* horizontal tab delay */ -+#define TAB0 0x00000000 -+#define TAB1 0x00000400 /* tty 37 */ -+#define TAB2 0x00000800 -+#define XTABS 0x00000c00 /* expand tabs on output */ -+#define CRDELAY 0x00003000 /* \r delay */ -+#define CR0 0x00000000 -+#define CR1 0x00001000 /* tn 300 */ -+#define CR2 0x00002000 /* tty 37 */ -+#define CR3 0x00003000 /* concept 100 */ -+#define VTDELAY 0x00004000 /* vertical tab delay */ -+#define FF0 0x00000000 -+#define FF1 0x00004000 /* tty 37 */ -+#define BSDELAY 0x00008000 /* \b delay */ -+#define BS0 0x00000000 -+#define BS1 0x00008000 -+#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY) -+#define CRTBS 0x00010000 /* do backspacing for crt */ -+#define PRTERA 0x00020000 /* \ ... / erase */ -+#define CRTERA 0x00040000 /* " \b " to wipe out char */ -+#define TILDE 0x00080000 /* hazeltine tilde kludge */ -+#define MDMBUF 0x00100000 /* DTR/DCD hardware flow control */ -+#define LITOUT 0x00200000 /* literal output */ -+#define TOSTOP 0x00400000 /* stop background jobs on output */ -+#define FLUSHO 0x00800000 /* output being flushed (state) */ -+#define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */ -+#define L001000 0x02000000 -+#define CRTKIL 0x04000000 /* kill line with " \b " */ -+#define PASS8 0x08000000 -+#define CTLECH 0x10000000 /* echo control chars as ^X */ -+#define PENDIN 0x20000000 /* re-echo input buffer at next read */ -+#define DECCTQ 0x40000000 /* only ^Q starts after ^S */ -+#define NOFLSH 0x80000000 -+#ifndef GAWK -+#include "term.h" -+#else -+#ifndef DLFCN_H -+#define DLFCN_H -+ -+#define RTLD_LAZY 1 -+extern void *dlopen (const char *, int); -+extern int dlclose (void *); -+extern void *dlsym (void *, const char *); -+extern char *dlerror (void); -+#endif /* DLFCN_H */ -+#endif -+#if ! defined(tchars) -+struct tchars { -+ char t_intrc; /* interrupt */ -+ char t_quitc; /* quit */ -+ char t_startc; /* start output */ -+ char t_stopc; /* stop output */ -+ char t_eofc; /* end-of-file */ -+ char t_brkc; /* input delimiter (like nl) */ -+ }; -+#endif -+#if ! defined(ltchars) -+struct ltchars { -+ char t_suspc; /* stop process signal */ -+ char t_dsuspc; /* delayed stop process signal */ -+ char t_rprntc; /* reprint line */ -+ char t_flushc; /*flush output (toggles) */ -+ char t_werasc; /* word erase */ -+ char t_lnextc; /* literal next character */ -+}; -+#endif -+struct ttyjunked { -+ char sg_ispeed; -+ char sg_ospeed; -+ char sg_erase; -+ char sg_kill; -+ short sg_flags; -+}; -+#endif -+/* -+ -+pdcurses provides these now -+ -+static int tgetflag (const char *name){ -+ return -1; -+} -+ -+static int tgetnum (){ -+ return -1; -+} -+static char *tgetstr (){ -+ return NULL; -+} -+ -+static int tgetent(char *bp, const char *name){ -+ return -1; -+} -+static int tputs(const char *str, int affcnt, int (*putc)(int)){ -+ return -1; -+} -+static char *tgoto(const char *cap, int col, int row){ -+ return NULL; -+} -+*/ -+#define SIGALRM 14 -+#if ! defined(BOOL) -+#define BOOL int -+ -+#endif -+#include -+#ifndef GAWK -+typedef struct HandleExec { -+ BOOL was_async; -+ pid_t child_pid; -+ char* cmd; -+ char** args; -+ int fake_exit_status; -+ posix_spawn_file_actions_t * actions; -+ posix_spawnattr_t* attrp; -+ char** envp; -+ int ___env_cur; -+ int ___env_max; -+ BOOL __has_run; -+ BOOL __has_forked; -+ BOOL __had_fake_exit; -+ -+} HandleExec; -+ -+HandleExec* ExecGetNew(void); -+static char* signal_names[36] = { -+ "EXIT", -+ "SIGHUP", -+ "SIGINT", -+ "SIGQUIT", -+ "SIGILL", -+ "SIGTRAP", -+ "SIGABRT", -+ "SIGEMT", -+ "SIGFPE", -+ "SIGKILL", -+ "SIGBUS", -+ "SIGSEGV", -+ "SIGSYS", -+ "SIGPIPE", -+ "SIGALRM", -+ "SIGTERM", -+ "SIGURG", -+ "SIGSTOP", -+ "SIGTSTP", -+ "SIGCONT", -+ "SIGCHLD", -+ "SIGTTIN", -+ "SIGTTOU", -+ "SIGIO", -+ "SIGXCPU", -+ "SIGXFSZ", -+ "SIGVTALRM", -+ "SIGPROF", -+ "SIGWINCH", -+ "SIGINFO", -+ "SIGUSR1", -+ "SIGUSR2", -+ "DEBUG", -+ "ERR", -+ "RETURN", -+ (char*)0x0 -+}; -+void ExecDupeEnvVar(HandleExec* exec, const char* varLine); -+static void __DupeOrUpdateEnvVarPair(HandleExec* exec, BOOL CHECK_EXISTING, const char* varName, const char* value); -+void ExecDupeEnvVarPair(HandleExec* exec, const char* varName, const char* value); -+void ExecDupeOrUpdateEnvVarPair(HandleExec* exec, const char* varName, const char* value); -+void ExecDestroy(HandleExec** exec_ptr); -+void ExecSetCmdAndArgs(HandleExec* exec, const char* cmd, const char** args); -+void ExecSetEnvVar(HandleExec* exec, const char** envp); -+BOOL ExecHasFakeExit(HandleExec* exec); -+void ExecSetFakeExit(HandleExec* exec, int ExitCode); -+int ExecDoSpawn(HandleExec* exec); -+#endif // !GAWK -+int kill(pid_t pid, int sig); -+int fchmod(int fd, mode_t mode); -+unsigned int alarm(unsigned int seconds); -+pid_t getpgrp(pid_t pid); -+pid_t getppid(void); -+pid_t wait(int* wstatus); -+ -+#if ! defined(GAWK) -+extern char* getenv2(const char* name); -+#undef getenv -+#define getenv getenv2 -+#undef _getenv -+#define _getenv _getenv2 -+#undef setenv -+#define setenv setenv2 -+#undef putenv -+#define putenv putenv2 -+#undef unsetenv -+#define unsetenv unsetenv2 -+ -+#endif -+ -+ -+ -+#ifdef _WIN32 -+#ifndef WIFEXITED -+#define WIFEXITED(w) (((w) & 0xff) == 0) -+#endif -+#ifndef WIFSIGNALED -+#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) -+#endif -+#ifndef WIFSTOPPED -+#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f) -+#endif -+#ifndef WEXITSTATUS -+#define WEXITSTATUS(w) (((w) >> 8) & 0xff) -+#endif -+#ifndef WTERMSIG -+#define WTERMSIG(w) ((w) & 0x7f) -+#endif -+#ifndef WSTOPSIG -+#define WSTOPSIG WEXITSTATUS -+#endif -+ -+ -+ -+ -+#endif ++//shared between bash and gawk ++#pragma once ++#ifdef _WIN32 ++#include "config.h" ++//with newer windows sdks the wrong header order in some files results in a SocketNotificationRetrieveEvents defined multiple times error, this is the easiest solution ive seen ++#ifndef WINSOCK_INCLUDED ++#define WINSOCK_INCLUDED 1 ++#include ++#include ++#endif ++ ++ ++ ++#define TTYSTRUCT struct ttyjunked ++ ++ ++#define TIOCHPCL _IO('t', 2) /* hang up on last close */ ++#define TIOCGETP _IOR('t', 8,TTYSTRUCT)/* get parameters -- gtty */ ++#define TIOCSETP _IOW('t', 9,TTYSTRUCT)/* set parameters -- stty */ ++#define TIOCSETN _IOW('t',10,TTYSTRUCT)/* as above, but no flushtty*/ ++#define TIOCSETC _IOW('t',17,struct tchars)/* set special characters */ ++#define TIOCGETC _IOR('t',18,struct tchars)/* get special characters */ ++#define TANDEM 0x00000001 /* send stopc on out q full */ ++#define CBREAK 0x00000002 /* half-cooked mode */ ++#define LCASE 0x00000004 /* simulate lower case */ ++#define ECHO 0x00000008 /* enable echoing */ ++#define CRMOD 0x00000010 /* map \r to \r\n on output */ ++#define RAW 0x00000020 /* no i/o processing */ ++#define ODDP 0x00000040 /* get/send odd parity */ ++#define EVENP 0x00000080 /* get/send even parity */ ++#define ANYP 0x000000c0 /* get any parity/send none */ ++#define NLDELAY 0x00000300 /* \n delay */ ++#define NL0 0x00000000 ++#define NL1 0x00000100 /* tty 37 */ ++#define NL2 0x00000200 /* vt05 */ ++#define NL3 0x00000300 ++#define TBDELAY 0x00000c00 /* horizontal tab delay */ ++#define TAB0 0x00000000 ++#define TAB1 0x00000400 /* tty 37 */ ++#define TAB2 0x00000800 ++#define XTABS 0x00000c00 /* expand tabs on output */ ++#define CRDELAY 0x00003000 /* \r delay */ ++#define CR0 0x00000000 ++#define CR1 0x00001000 /* tn 300 */ ++#define CR2 0x00002000 /* tty 37 */ ++#define CR3 0x00003000 /* concept 100 */ ++#define VTDELAY 0x00004000 /* vertical tab delay */ ++#define FF0 0x00000000 ++#define FF1 0x00004000 /* tty 37 */ ++#define BSDELAY 0x00008000 /* \b delay */ ++#define BS0 0x00000000 ++#define BS1 0x00008000 ++#define ALLDELAY (NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY) ++#define CRTBS 0x00010000 /* do backspacing for crt */ ++#define PRTERA 0x00020000 /* \ ... / erase */ ++#define CRTERA 0x00040000 /* " \b " to wipe out char */ ++#define TILDE 0x00080000 /* hazeltine tilde kludge */ ++#define MDMBUF 0x00100000 /* DTR/DCD hardware flow control */ ++#define LITOUT 0x00200000 /* literal output */ ++#define TOSTOP 0x00400000 /* stop background jobs on output */ ++#define FLUSHO 0x00800000 /* output being flushed (state) */ ++#define NOHANG 0x01000000 /* (no-op) was no SIGHUP on carrier drop */ ++#define L001000 0x02000000 ++#define CRTKIL 0x04000000 /* kill line with " \b " */ ++#define PASS8 0x08000000 ++#define CTLECH 0x10000000 /* echo control chars as ^X */ ++#define PENDIN 0x20000000 /* re-echo input buffer at next read */ ++#define DECCTQ 0x40000000 /* only ^Q starts after ^S */ ++#define NOFLSH 0x80000000 ++#ifndef GAWK ++#include "term.h" ++#else ++#ifndef DLFCN_H ++#define DLFCN_H ++ ++#define RTLD_LAZY 1 ++extern void *dlopen (const char *, int); ++extern int dlclose (void *); ++extern void *dlsym (void *, const char *); ++extern char *dlerror (void); ++#endif /* DLFCN_H */ ++#endif ++#if ! defined(tchars) ++struct tchars { ++ char t_intrc; /* interrupt */ ++ char t_quitc; /* quit */ ++ char t_startc; /* start output */ ++ char t_stopc; /* stop output */ ++ char t_eofc; /* end-of-file */ ++ char t_brkc; /* input delimiter (like nl) */ ++ }; ++#endif ++#if ! defined(ltchars) ++struct ltchars { ++ char t_suspc; /* stop process signal */ ++ char t_dsuspc; /* delayed stop process signal */ ++ char t_rprntc; /* reprint line */ ++ char t_flushc; /*flush output (toggles) */ ++ char t_werasc; /* word erase */ ++ char t_lnextc; /* literal next character */ ++}; ++#endif ++struct ttyjunked { ++ char sg_ispeed; ++ char sg_ospeed; ++ char sg_erase; ++ char sg_kill; ++ short sg_flags; ++}; ++#endif ++/* ++ ++pdcurses provides these now ++ ++static int tgetflag (const char *name){ ++ return -1; ++} ++ ++static int tgetnum (){ ++ return -1; ++} ++static char *tgetstr (){ ++ return NULL; ++} ++ ++static int tgetent(char *bp, const char *name){ ++ return -1; ++} ++static int tputs(const char *str, int affcnt, int (*putc)(int)){ ++ return -1; ++} ++static char *tgoto(const char *cap, int col, int row){ ++ return NULL; ++} ++*/ ++#define SIGALRM 14 ++#if ! defined(BOOL) ++#define BOOL int ++ ++#endif ++#include ++#ifndef GAWK ++typedef struct HandleExec { ++ BOOL was_async; ++ pid_t child_pid; ++ char* cmd; ++ char** args; ++ int fake_exit_status; ++ posix_spawn_file_actions_t * actions; ++ posix_spawnattr_t* attrp; ++ char** envp; ++ int ___env_cur; ++ int ___env_max; ++ BOOL __has_run; ++ BOOL __has_forked; ++ BOOL __had_fake_exit; ++ ++} HandleExec; ++ ++HandleExec* ExecGetNew(void); ++static char* signal_names[36] = { ++ "EXIT", ++ "SIGHUP", ++ "SIGINT", ++ "SIGQUIT", ++ "SIGILL", ++ "SIGTRAP", ++ "SIGABRT", ++ "SIGEMT", ++ "SIGFPE", ++ "SIGKILL", ++ "SIGBUS", ++ "SIGSEGV", ++ "SIGSYS", ++ "SIGPIPE", ++ "SIGALRM", ++ "SIGTERM", ++ "SIGURG", ++ "SIGSTOP", ++ "SIGTSTP", ++ "SIGCONT", ++ "SIGCHLD", ++ "SIGTTIN", ++ "SIGTTOU", ++ "SIGIO", ++ "SIGXCPU", ++ "SIGXFSZ", ++ "SIGVTALRM", ++ "SIGPROF", ++ "SIGWINCH", ++ "SIGINFO", ++ "SIGUSR1", ++ "SIGUSR2", ++ "DEBUG", ++ "ERR", ++ "RETURN", ++ (char*)0x0 ++}; ++void ExecDupeEnvVar(HandleExec* exec, const char* varLine); ++static void __DupeOrUpdateEnvVarPair(HandleExec* exec, BOOL CHECK_EXISTING, const char* varName, const char* value); ++void ExecDupeEnvVarPair(HandleExec* exec, const char* varName, const char* value); ++void ExecDupeOrUpdateEnvVarPair(HandleExec* exec, const char* varName, const char* value); ++void ExecDestroy(HandleExec** exec_ptr); ++void ExecSetCmdAndArgs(HandleExec* exec, const char* cmd, const char** args); ++void ExecSetEnvVar(HandleExec* exec, const char** envp); ++BOOL ExecHasFakeExit(HandleExec* exec); ++void ExecSetFakeExit(HandleExec* exec, int ExitCode); ++int ExecDoSpawn(HandleExec* exec); ++#endif // !GAWK ++int kill(pid_t pid, int sig); ++int fchmod(int fd, mode_t mode); ++unsigned int alarm(unsigned int seconds); ++pid_t getpgrp(pid_t pid); ++pid_t getppid(void); ++pid_t wait(int* wstatus); ++ ++#if ! defined(GAWK) ++extern char* getenv2(const char* name); ++#undef getenv ++#define getenv getenv2 ++#undef _getenv ++#define _getenv _getenv2 ++#undef setenv ++#define setenv setenv2 ++#undef putenv ++#define putenv putenv2 ++#undef unsetenv ++#define unsetenv unsetenv2 ++ ++#endif ++ ++ ++ ++#ifdef _WIN32 ++#ifndef WIFEXITED ++#define WIFEXITED(w) (((w) & 0xff) == 0) ++#endif ++#ifndef WIFSIGNALED ++#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) ++#endif ++#ifndef WIFSTOPPED ++#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f) ++#endif ++#ifndef WEXITSTATUS ++#define WEXITSTATUS(w) (((w) >> 8) & 0xff) ++#endif ++#ifndef WTERMSIG ++#define WTERMSIG(w) ((w) & 0x7f) ++#endif ++#ifndef WSTOPSIG ++#define WSTOPSIG WEXITSTATUS ++#endif ++ ++ ++ ++ ++#endif diff --git a/posix/gawkmisc.c b/posix/gawkmisc.c index 0b30d746..60d75638 100644 --- a/posix/gawkmisc.c