diff options
author | Eli Zaretskii <eliz@gnu.org> | 2019-02-02 11:52:51 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2019-02-02 11:52:51 +0200 |
commit | f0be506c0b0c2a220e0a3112dca91ec352aad530 (patch) | |
tree | 9057e60f54d90244a6f62708fbd0ab7542360d1c | |
parent | ed3ce8fb4800e0746726d7d59642518fa4983889 (diff) | |
download | egawk-f0be506c0b0c2a220e0a3112dca91ec352aad530.tar.gz egawk-f0be506c0b0c2a220e0a3112dca91ec352aad530.tar.bz2 egawk-f0be506c0b0c2a220e0a3112dca91ec352aad530.zip |
Fix compilation errors and warnings with MinGW64.
-rwxr-xr-x | ChangeLog | 12 | ||||
-rw-r--r-- | debug.c | 6 | ||||
-rw-r--r-- | nonposix.h | 6 | ||||
-rw-r--r-- | pc/ChangeLog | 5 | ||||
-rw-r--r-- | pc/gawkmisc.pc | 2 |
5 files changed, 29 insertions, 2 deletions
@@ -1,3 +1,15 @@ +2019-02-02 Eli Zaretskii <eliz@gnu.org> + + * nonposix.h: If setlocale is already a defined macro, #undef it + before redefining. This avoids compilation warnings if someone + tries to compile Gawk with Gettext's libintl.h, which redirects + setlocale to its own function. + Reported by Budi <budikusasi@gmail.com>. + + * debug.c [__MINGW32__]: Prototype for w32_execvp. + (restart) [__MINGW32__]: Call w32_execvp instead of execvp. Don't + type-cast d_argv anymore. + 2019-01-27 Arnold D. Robbins <arnold@skeeve.com> * awkgram.y (qualify_name): Return duplicated strings. @@ -30,6 +30,10 @@ #include <fcntl.h> /* open() */ #endif +#ifdef __MINGW32__ +int w32_execvp(const char *, char **); +#endif + extern bool exiting; extern SRCFILE *srcfiles; extern INSTRUCTION *rule_list; @@ -2915,7 +2919,7 @@ restart(bool run) /* start a new process replacing the current process */ #ifdef __MINGW32__ - execvp(d_argv[0], (const char * const *)d_argv); + w32_execvp(d_argv[0], d_argv); #else execvp(d_argv[0], d_argv); #endif @@ -57,6 +57,12 @@ int unsetenv (const char *); int setenv (const char *, const char *, int); void w32_maybe_set_errno (void); char *w32_setlocale (int, const char *); +/* libintl.h from GNU gettext defines setlocale to redirect that to + its own function. Note: this will have to be revisited if MinGW + Gawk will support ENABLE_NLS at some point. */ +#ifdef setlocale +# undef setlocale +#endif #define setlocale(c,v) w32_setlocale(c,v) #endif /* __MINGW32__ */ diff --git a/pc/ChangeLog b/pc/ChangeLog index 3e63e209..18bbbf15 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,5 +1,10 @@ 2019-02-02 Eli Zaretskii <eliz@gnu.org> + * gawkmisc.pc (w32_execvp) [__MINGW32__]: Renamed from execvp, to + avoid compiler errors with MinGW64, which stupidly defined a + deviant prototype for execvp, because GCC's built-in does. + Reported by Budi <budikusasi@gmail.com>. + * Makefile.tst (typedregex4): * GenMakefileTst.awk (substitutions): Replace a literal slash with $(SLASH) in the typedregex4 test. diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc index 7c4436ef..2e581011 100644 --- a/pc/gawkmisc.pc +++ b/pc/gawkmisc.pc @@ -794,7 +794,7 @@ nl_langinfo (int item) * * This will need work if we ever need a real version of execvp. */ -int execvp(const char *file, const char *const *argv) +int w32_execvp(const char *file, char **argv) { if (_spawnvp(_P_WAIT, file, (const char * const *)argv) != -1) exit(EXIT_SUCCESS); |