[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, master, updated. gawk-4.1.0-4838-gc1de10ee
From: |
Eli Zaretskii |
Subject: |
[SCM] gawk branch, master, updated. gawk-4.1.0-4838-gc1de10ee |
Date: |
Mon, 8 Aug 2022 08:18:37 -0400 (EDT) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, master has been updated
via c1de10ee6594d8e22168cb0ca9783eda422d59ba (commit)
from e97f77ec5e8786df682cdbc268886c70cc3e1669 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=c1de10ee6594d8e22168cb0ca9783eda422d59ba
commit c1de10ee6594d8e22168cb0ca9783eda422d59ba
Author: Eli Zaretskii <eliz@gnu.org>
Date: Mon Aug 8 15:17:39 2022 +0300
Fix the MinGW build.
diff --git a/ChangeLog b/ChangeLog
index c0b2df70..1fdc5fb3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-08-08 Eli Zaretskii <eliz@gnu.org>
+
+ * nonposix.h [__MINGW32__]: Add prototype for strsignal.
+
+ * awk.h (flags): Rename BOOL => BOOLVAL, to avoid conflicts with
+ MS-Windows headers. All users changed.
+
2022-08-07 Arnold D. Robbins <arnold@skeeve.com>
* main.c (get_pma_version): New function.
diff --git a/README_d/README.pc b/README_d/README.pc
index a5f84c66..e67590cf 100644
--- a/README_d/README.pc
+++ b/README_d/README.pc
@@ -61,9 +61,9 @@ their end-of-line markers converted, as described in
Makefile.tst.
One change you will have to make for testing the MinGW port using the
MSYS Bash is to set SLASH to //.
-Testing Gawk built with MPFR support should report 28 tests failed, and
+Testing Gawk built with MPFR support should report 31 tests failed, and
if your ls.exe doesn't produce inode numbers consistent with the readdir
-extension, you should see 31 failures. If you see more failures, you
+extension, you should see 32 failures. If you see more failures, you
should investigate the reasons.
It is routine to install by hand, but note that the install target also
diff --git a/awk.h b/awk.h
index bbe817dd..834da65a 100644
--- a/awk.h
+++ b/awk.h
@@ -450,7 +450,7 @@ typedef struct exp_node {
NUMBER = 0x0010, /* assigned as number */
USER_INPUT = 0x0020, /* user input: if NUMERIC then
* a NUMBER */
- BOOL = 0x0040, /* this is a boolean value */
+ BOOLVAL = 0x0040, /* this is a boolean value */
INTLSTR = 0x0080, /* use localized version */
NUMINT = 0x0100, /* numeric value is an integer */
INTIND = 0x0200, /* integral value is array index;
diff --git a/builtin.c b/builtin.c
index b92db992..4d06ea7a 100644
--- a/builtin.c
+++ b/builtin.c
@@ -4326,8 +4326,8 @@ do_typeof(int nargs)
}
break;
case Node_val:
- switch (fixtype(arg)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
- case NUMBER|BOOL:
+ switch (fixtype(arg)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOLVAL)) {
+ case NUMBER|BOOLVAL:
res = "number|bool";
break;
case NUMBER:
diff --git a/eval.c b/eval.c
index 59d9dcf8..54b38799 100644
--- a/eval.c
+++ b/eval.c
@@ -444,7 +444,7 @@ flags2str(int flagval)
{ NUMCUR, "NUMCUR" },
{ NUMBER, "NUMBER" },
{ USER_INPUT, "USER_INPUT" },
- { BOOL, "BOOL" },
+ { BOOLVAL, "BOOL" },
{ INTLSTR, "INTLSTR" },
{ NUMINT, "NUMINT" },
{ INTIND, "INTIND" },
diff --git a/gawkapi.c b/gawkapi.c
index 195ade53..b2fb3fd8 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -546,7 +546,7 @@ assign_regex(NODE *node, awk_value_t *val)
static inline void
assign_bool(NODE *node, awk_value_t *val)
{
- assert((node->flags & BOOL) != 0);
+ assert((node->flags & BOOLVAL) != 0);
val->val_type = AWK_BOOL;
val->bool_value = get_number_si(node) != 0 ? awk_true : awk_false;
}
@@ -588,7 +588,7 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
/* a scalar value */
switch (wanted) {
case AWK_BOOL:
- if ((node->flags & BOOL) != 0) {
+ if ((node->flags & BOOLVAL) != 0) {
assign_bool(node, val);
ret = awk_true;
} else
@@ -606,8 +606,8 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
break;
case AWK_STRNUM:
- switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
- case NUMBER|BOOL:
+ switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOLVAL)) {
+ case NUMBER|BOOLVAL:
val->val_type = AWK_BOOL;
break;
case STRING:
@@ -643,11 +643,11 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
break;
case AWK_REGEX:
- switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
+ switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOLVAL)) {
case STRING:
val->val_type = AWK_STRING;
break;
- case NUMBER|BOOL:
+ case NUMBER|BOOLVAL:
val->val_type = AWK_BOOL;
break;
case NUMBER:
@@ -674,8 +674,8 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
break;
case AWK_SCALAR:
- switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
- case NUMBER|BOOL:
+ switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOLVAL)) {
+ case NUMBER|BOOLVAL:
val->val_type = AWK_BOOL;
break;
case STRING:
@@ -705,8 +705,8 @@ node_to_awk_value(NODE *node, awk_value_t *val,
awk_valtype_t wanted)
case AWK_UNDEFINED:
/* return true and actual type for request of undefined
*/
- switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
- case NUMBER|BOOL:
+ switch (fixtype(node)->flags &
(STRING|NUMBER|USER_INPUT|REGEX|BOOLVAL)) {
+ case NUMBER|BOOLVAL:
assign_bool(node, val);
ret = awk_true;
break;
diff --git a/node.c b/node.c
index 7b4346bf..f069108d 100644
--- a/node.c
+++ b/node.c
@@ -1107,7 +1107,7 @@ make_bool_node(bool value)
val = make_number(nval);
val->stptr = estrdup(sval, strlen(sval));
val->stlen = strlen(sval);
- val->flags |= NUMCUR|STRCUR|BOOL;
+ val->flags |= NUMCUR|STRCUR|BOOLVAL;
val->stfmt = STFMT_UNUSED;
return val;
diff --git a/nonposix.h b/nonposix.h
index 92a79504..2cffc505 100644
--- a/nonposix.h
+++ b/nonposix.h
@@ -65,6 +65,8 @@ char *w32_setlocale (int, const char *);
#endif
#define setlocale(c,v) w32_setlocale(c,v)
+char *strsignal (int);
+
#endif /* __MINGW32__ */
#if defined(VMS) || defined(__MINGW32__)
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 7d52ee6b..6b0c8acc 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,15 @@
+2022-08-08 Eli Zaretskii <eliz@gnu.org>
+
+ * config.sed, config.h: Define HAVE_STRSIGNAL.
+
+ * gawkmisc.pc (memcpy_ulong, memset_ulong): Remove unused
+ functions.
+ (os_close_on_exec): Remove DJGPP code.
+ (os_isatty): Remove non-MinGW code.
+ (strsignal): New function.
+
+ * Makefile ($(ALLOBJS) $(LIBOBJS) $(DYNOBJS)): Remove mbsupport.h.
+
2022-08-07 Arnold D. Robbins <arnold@skeeve.com>
* GenMakefileTst.awk: Fix substitution of `ls' to work
diff --git a/pc/Makefile b/pc/Makefile
index 9ce306ac..91ccddd8 100644
--- a/pc/Makefile
+++ b/pc/Makefile
@@ -181,7 +181,7 @@ $(RSPFILE) : $(GAWKOBJS)
# included by awk.h.
# 2. custom.h is not mentioned because pc ports don't use it.
$(ALLOBJS) $(LIBOBJS) $(DYNOBJS): \
- awk.h regex.h config.h gettext.h mbsupport.h protos.h dfa.h getopt.h
nonposix.h
+ awk.h regex.h config.h gettext.h protos.h dfa.h getopt.h nonposix.h
$(DYNOBJS) regex$O: dynarray.h libc-config.h malloc/dynarray.h
malloc/dynarray-skeleton.c
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index 7043bea6..5c24843c 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -1270,6 +1270,7 @@ typedregex4:
iolint:
@echo $@ $(ZOS_FAIL)
+ @echo Expect $@ to fail with MinGW.
@echo hello > 'echo hello'
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
@@ -1475,6 +1476,7 @@ closebad:
close_status:
@echo $@
+ @echo Expect $@ to fail with MinGW.
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
@@ -3134,6 +3136,7 @@ nsfuncrecurse:
nsidentifier:
@echo $@
+ @echo Expect $@ to fail with MinGW.
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
diff --git a/pc/config.h b/pc/config.h
index 59f3578c..0388c02d 100644
--- a/pc/config.h
+++ b/pc/config.h
@@ -245,7 +245,7 @@
#undef HAVE_STROPTS_H
/* Define to 1 if you have the `strsignal' function. */
-#undef HAVE_STRSIGNAL
+#define HAVE_STRSIGNAL 1
/* Define to 1 if you have the `strtod' function. */
#define HAVE_STRTOD 1
diff --git a/pc/config.sed b/pc/config.sed
index 8fbf183b..f5e6308e 100644
--- a/pc/config.sed
+++ b/pc/config.sed
@@ -109,6 +109,7 @@ s/^#undef HAVE_STRINGS_H *$/#define HAVE_STRINGS_H 1/
s/^#undef HAVE_STRING_H *$/#define HAVE_STRING_H 1/
/^#undef HAVE_STRNCASECMP *$/c\
#define HAVE_STRNCASECMP 1
+s/^#undef HAVE_STRSIGNAL *$/#define HAVE_STRSIGNAL 1/
s/^#undef HAVE_STRTOD *$/#define HAVE_STRTOD 1/
/^#undef HAVE_STRTOUL *$/c\
#define HAVE_STRTOUL 1
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index 003d54a1..14df736b 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -34,6 +34,7 @@ const char *defpath = ".;c:\\lib\\awk;c:\\gnu\\lib\\awk";
const char *deflibpath = DEFLIBPATH;
#ifdef __MINGW32__
+
#ifdef HAVE_SOCKETS
#include <socket.h>
@@ -49,7 +50,6 @@ const char *deflibpath = DEFLIBPATH;
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#endif
/* gawk_name --- pull out the "gawk" part from how the OS called us */
@@ -73,41 +73,6 @@ const char *filespec;
}
-/*
- * memcpy_long() & memset_ulong() are 32-bit replacements for MSC which
- * has a 16-bit size_t.
- */
-char *
-memcpy_ulong (dest, src, l)
-register char *dest;
-register const char *src;
-register unsigned long l;
-{
- register char *ret = dest;
-
- while (l--)
- *dest++ = *src++;
-
- return ret;
-}
-
-
-void *
-memset_ulong(dest, val, l)
-void *dest;
-register int val;
-register unsigned long l;
-{
- register char *ret = dest;
- register char *d = dest;
-
- while (l--)
- *d++ = val;
-
- return ((void *) ret);
-}
-
-
/* os_arg_fixup --- fixup the command line */
void
@@ -193,20 +158,10 @@ os_close_on_exec(fd, name, what, dir)
int fd;
const char *name, *what, *dir;
{
-#if __DJGPP__ > 2 || __DJGPP_MINOR__ >= 4
- if (fd <= 2) /* sanity */
- return;
-
- if (fcntl(fd, F_SETFD, 1) < 0)
- warning("%s %s `%s': could not set close-on-exec: %s",
- what, dir, name, strerror(errno));
-#endif
-#ifdef __MINGW32__
HANDLE fh = (HANDLE)_get_osfhandle(fd);
if (fh && fh != INVALID_HANDLE_VALUE)
SetHandleInformation(fh, HANDLE_FLAG_INHERIT, 0);
-#endif
}
/* os_isdir --- is this an fd on a directory? */
@@ -289,11 +244,7 @@ int fd;
int
os_isatty(int fd)
{
-#if defined(__MINGW32__) || defined(_MSC_VER)
return (isatty(fd) && lseek(fd, SEEK_CUR, 0) == -1);
-#else
- return isatty(fd);
-#endif
}
/* files_are_same --- return true if files are identical */
@@ -331,8 +282,6 @@ files_are_same(char *path, SRCFILE *src)
return 0;
}
-#ifdef __MINGW32__
-
extern void *xmalloc (size_t);
int
@@ -800,6 +749,31 @@ w32_status_to_termsig (unsigned status)
return SIGTERM;
}
+/* Emulate the missing strsignal. */
+char *
+strsignal (int signo)
+{
+ switch (signo)
+ {
+ case SIGINT:
+ return "SIGINT";
+ case SIGILL:
+ return "SIGILL";
+ case SIGFPE:
+ return "SIGFPE";
+ case SIGSEGV:
+ return "SIGSEGV";
+ case SIGTERM:
+ return "SIGTERM";
+ case SIGBREAK:
+ return "SIGBREAK";
+ case SIGABRT:
+ return "SIGABRT";
+ default:
+ return "Unknown signal";
+ }
+}
+
void
os_maybe_set_errno (void)
{
@@ -824,10 +798,6 @@ os_maybe_set_errno (void)
}
}
-#endif /* __MINGW32__ */
-
-#if defined(__MINGW32__)
-
void
init_sockets(void)
{
diff --git a/test/ChangeLog b/test/ChangeLog
index 648df5e9..403a9fda 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2022-08-07 Eli Zaretskii <eliz@gnu.org>
+
+ * Makefile.am (EXPECTED_FAIL_MINGW): Add 3 failing tests.
+
2022-07-27 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): Add makepmafile.c and pma.ok.
diff --git a/test/Makefile.am b/test/Makefile.am
index 9c69d474..72adc09b 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1602,10 +1602,10 @@ NEED_LOCALE_RU = mtchi18n
# List of tests that fail on MinGW
EXPECTED_FAIL_MINGW = \
- backbigs1 backsmalls1 clos1way6 devfd devfd1 devfd2 \
+ backbigs1 backsmalls1 clos1way6 close_status devfd devfd1 devfd2 \
errno exitval2 fork fork2 fts functab5 \
getfile getlnhd ignrcas3 inetdayt inetecht inf-nan-torture \
- mbfw1 mbprintf1 mbprintf4 mbstr1 mbstr2 \
+ iolint mbfw1 mbprintf1 mbprintf4 mbstr1 mbstr2 nsidentifier \
pid pipeio2 pty1 pty2 readdir rstest4 rstest5 status-close timeout
# List of tests that fail on z/OS
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++
README_d/README.pc | 4 +--
awk.h | 2 +-
builtin.c | 4 +--
eval.c | 2 +-
gawkapi.c | 20 ++++++-------
node.c | 2 +-
nonposix.h | 2 ++
pc/ChangeLog | 12 ++++++++
pc/Makefile | 2 +-
pc/Makefile.tst | 3 ++
pc/config.h | 2 +-
pc/config.sed | 1 +
pc/gawkmisc.pc | 82 +++++++++++++++++-------------------------------------
test/ChangeLog | 4 +++
test/Makefile.am | 4 +--
16 files changed, 76 insertions(+), 77 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, master, updated. gawk-4.1.0-4838-gc1de10ee,
Eli Zaretskii <=