aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-08-09 22:16:41 +0300
committerArnold D. Robbins <arnold@skeeve.com>2017-08-09 22:16:41 +0300
commitd16278e6441adcc416d70c43b2ea6a4474f221c5 (patch)
tree4bcfb44fe0c8eef34d409730d0793842656c0965
parente9786ddcfcdeae8e6230f9c4b8f51445a3ff1d9c (diff)
parent5557a45fbe813ba13eda8b78a16f84621a9794ee (diff)
downloadegawk-d16278e6441adcc416d70c43b2ea6a4474f221c5.tar.gz
egawk-d16278e6441adcc416d70c43b2ea6a4474f221c5.tar.bz2
egawk-d16278e6441adcc416d70c43b2ea6a4474f221c5.zip
Merge branch 'master' into feature/api-mpfr
-rw-r--r--ChangeLog7
-rw-r--r--NEWS2
-rw-r--r--README6
-rw-r--r--awk.h4
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/gawk.info137
-rw-r--r--doc/gawk.texi16
-rw-r--r--doc/gawktexi.in16
-rw-r--r--nonposix.h7
-rw-r--r--pc/ChangeLog10
-rw-r--r--pc/Makefile8
-rw-r--r--pc/config.sed95
-rw-r--r--pc/gawkmisc.pc10
13 files changed, 202 insertions, 121 deletions
diff --git a/ChangeLog b/ChangeLog
index 9d50ff41..fa603448 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,13 @@
* config.guess, mkinstalldirs: Updated from GNULIB.
+2017-08-01 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ Bring DJGPP support up to speed.
+
+ * awk.h: Add DJGPP in #if for include of nonposix.h
+ * nonposix.h (btowc, putwc): Add declarations for DJGPP.
+
2017-07-17 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y [non_post_simp_exp]: Merge LEX_BUILTIN and
diff --git a/NEWS b/NEWS
index 327b9259..e4963d4e 100644
--- a/NEWS
+++ b/NEWS
@@ -122,6 +122,8 @@ Changes from 4.1.x to 4.2.0
were in the source file. This solves several niggling corner cases
with such things.
+30. The DJGPP port has been revived and now has an official maintainer.
+
Changes from 4.1.3 to 4.1.4
---------------------------
diff --git a/README b/README
index 57e6c32c..11ff38cc 100644
--- a/README
+++ b/README
@@ -80,9 +80,9 @@ Arnold Robbins
BUG REPORTS AND FIXES, non-Unix systems:
-MS-DOS with DJGPP: (This port is deprecated.)
- Scott Deifik
- scottd.mail@sbcglobal.net
+MS-DOS with DJGPP:
+ Juan Manuel Guerrero
+ juan.guerrero@gmx.de
MS-Windows with MinGW:
Eli Zaretskii
diff --git a/awk.h b/awk.h
index e19b2536..80e597f1 100644
--- a/awk.h
+++ b/awk.h
@@ -182,9 +182,9 @@ extern void *memset_ulong(void *dest, int val, unsigned long l);
#define fwrite fwrite_unlocked
#endif /* HAVE_FWRITE_UNLOCKED */
-#if defined(__EMX__) || defined(__MINGW32__)
+#if defined(__DJGPP__) || defined(__EMX__) || defined(__MINGW32__)
#include "nonposix.h"
-#endif /* defined(__EMX__) || defined(__MINGW32__) */
+#endif /* defined(__DJGPP__) || defined(__EMX__) || defined(__MINGW32__) */
/* use this as lintwarn("...")
this is a hack but it gives us the right semantics */
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 26729b9d..b7d06538 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -2,6 +2,11 @@
* texinfo.tex: Updated.
+2017-08-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Update with info about DJGPP port now
+ being supported.
+
2017-07-28 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in (Type Functions): Improve the example
diff --git a/doc/gawk.info b/doc/gawk.info
index 6a339595..2c0f9493 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -28281,6 +28281,8 @@ Info file, in approximate chronological order:
chapters that were severely dated, for which I am incredibly
grateful.
+ * Juan Manuel Guerrero took over maintenance of the DJGPP port.
+
* Arnold Robbins has been working on 'gawk' since 1988, at first
helping David Trueman, and as the primary maintainer since around
1994.
@@ -29394,6 +29396,8 @@ should be considered authoritative if it conflicts with this Info file.
Unix and POSIX Arnold Robbins, <arnold@skeeve.com>
systems
+MS-DOS with DJGPP Juan Manuel Guerrero, <juan.guerrero@gmx.de>
+
MS-Windows with MinGW Eli Zaretskii, <eliz@gnu.org>
OS/2 Andreas Buening, <andreas.buening@nexgo.de>
@@ -29406,10 +29410,6 @@ z/OS (OS/390) Daniel Richard G. <skunk@iSKUNK.ORG>
If your bug is also reproducible under Unix, send a copy of your
report to the <bug-gawk@gnu.org> email list as well.
- The DJGPP port is no longer supported; it will remain in the code
-base for a while in case a volunteer wishes to take it over. If this
-does not happen, then eventually code for this port will be removed.
-

File: gawk.info, Node: Other Versions, Next: Installation summary, Prev: Bugs, Up: Installation
@@ -34301,6 +34301,7 @@ Index
* gsub <1>: String Functions. (line 139)
* gsub() function, arguments of: String Functions. (line 465)
* gsub() function, escape processing: Gory Details. (line 6)
+* Guerrero, Juan Manuel: Contributors. (line 145)
* h debugger command (alias for help): Miscellaneous Debugger Commands.
(line 69)
* Hankerson, Darrel: Acknowledgments. (line 60)
@@ -35138,7 +35139,7 @@ Index
* Robbins, Arnold <2>: Passwd Functions. (line 90)
* Robbins, Arnold <3>: Alarm Program. (line 6)
* Robbins, Arnold <4>: General Data Types. (line 6)
-* Robbins, Arnold <5>: Contributors. (line 145)
+* Robbins, Arnold <5>: Contributors. (line 147)
* Robbins, Arnold <6>: Maintainers. (line 14)
* Robbins, Arnold <7>: Future Extensions. (line 6)
* Robbins, Bill: Getline/Pipe. (line 40)
@@ -36193,68 +36194,68 @@ Ref: Ranges and Locales-Footnote-11136430
Ref: Ranges and Locales-Footnote-21136457
Ref: Ranges and Locales-Footnote-31136692
Node: Contributors1136913
-Node: History summary1142473
-Node: Installation1143853
-Node: Gawk Distribution1144797
-Node: Getting1145281
-Node: Extracting1146242
-Node: Distribution contents1147880
-Node: Unix Installation1154222
-Node: Quick Installation1154904
-Node: Shell Startup Files1157318
-Node: Additional Configuration Options1158407
-Node: Configuration Philosophy1160396
-Node: Non-Unix Installation1162765
-Node: PC Installation1163225
-Node: PC Binary Installation1164063
-Node: PC Compiling1164498
-Node: PC Using1165615
-Node: Cygwin1168660
-Node: MSYS1169430
-Node: VMS Installation1169931
-Node: VMS Compilation1170722
-Ref: VMS Compilation-Footnote-11171951
-Node: VMS Dynamic Extensions1172009
-Node: VMS Installation Details1173694
-Node: VMS Running1175947
-Node: VMS GNV1180226
-Node: VMS Old Gawk1180961
-Node: Bugs1181432
-Node: Bug address1182095
-Node: Usenet1184492
-Node: Maintainers1185269
-Node: Other Versions1186645
-Node: Installation summary1193229
-Node: Notes1194264
-Node: Compatibility Mode1195129
-Node: Additions1195911
-Node: Accessing The Source1196836
-Node: Adding Code1198271
-Node: New Ports1204489
-Node: Derived Files1208977
-Ref: Derived Files-Footnote-11214462
-Ref: Derived Files-Footnote-21214497
-Ref: Derived Files-Footnote-31215095
-Node: Future Extensions1215209
-Node: Implementation Limitations1215867
-Node: Extension Design1217050
-Node: Old Extension Problems1218204
-Ref: Old Extension Problems-Footnote-11219722
-Node: Extension New Mechanism Goals1219779
-Ref: Extension New Mechanism Goals-Footnote-11223143
-Node: Extension Other Design Decisions1223332
-Node: Extension Future Growth1225445
-Node: Old Extension Mechanism1226281
-Node: Notes summary1228044
-Node: Basic Concepts1229226
-Node: Basic High Level1229907
-Ref: figure-general-flow1230189
-Ref: figure-process-flow1230874
-Ref: Basic High Level-Footnote-11234175
-Node: Basic Data Typing1234360
-Node: Glossary1237688
-Node: Copying1269635
-Node: GNU Free Documentation License1307174
-Node: Index1332292
+Node: History summary1142541
+Node: Installation1143921
+Node: Gawk Distribution1144865
+Node: Getting1145349
+Node: Extracting1146310
+Node: Distribution contents1147948
+Node: Unix Installation1154290
+Node: Quick Installation1154972
+Node: Shell Startup Files1157386
+Node: Additional Configuration Options1158475
+Node: Configuration Philosophy1160464
+Node: Non-Unix Installation1162833
+Node: PC Installation1163293
+Node: PC Binary Installation1164131
+Node: PC Compiling1164566
+Node: PC Using1165683
+Node: Cygwin1168728
+Node: MSYS1169498
+Node: VMS Installation1169999
+Node: VMS Compilation1170790
+Ref: VMS Compilation-Footnote-11172019
+Node: VMS Dynamic Extensions1172077
+Node: VMS Installation Details1173762
+Node: VMS Running1176015
+Node: VMS GNV1180294
+Node: VMS Old Gawk1181029
+Node: Bugs1181500
+Node: Bug address1182163
+Node: Usenet1184560
+Node: Maintainers1185337
+Node: Other Versions1186598
+Node: Installation summary1193182
+Node: Notes1194217
+Node: Compatibility Mode1195082
+Node: Additions1195864
+Node: Accessing The Source1196789
+Node: Adding Code1198224
+Node: New Ports1204442
+Node: Derived Files1208930
+Ref: Derived Files-Footnote-11214415
+Ref: Derived Files-Footnote-21214450
+Ref: Derived Files-Footnote-31215048
+Node: Future Extensions1215162
+Node: Implementation Limitations1215820
+Node: Extension Design1217003
+Node: Old Extension Problems1218157
+Ref: Old Extension Problems-Footnote-11219675
+Node: Extension New Mechanism Goals1219732
+Ref: Extension New Mechanism Goals-Footnote-11223096
+Node: Extension Other Design Decisions1223285
+Node: Extension Future Growth1225398
+Node: Old Extension Mechanism1226234
+Node: Notes summary1227997
+Node: Basic Concepts1229179
+Node: Basic High Level1229860
+Ref: figure-general-flow1230142
+Ref: figure-process-flow1230827
+Ref: Basic High Level-Footnote-11234128
+Node: Basic Data Typing1234313
+Node: Glossary1237641
+Node: Copying1269588
+Node: GNU Free Documentation License1307127
+Node: Index1332245

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index ae389448..3fa98afd 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -38366,6 +38366,7 @@ Juan Grigera
provided a port to Windows32 systems.
(This is no longer supported.)
+
@item
@cindex Hankerson, Darrel
For many years,
@@ -38506,6 +38507,10 @@ Antonio Giovanni Colombo rewrote a number of examples in the early
chapters that were severely dated, for which I am incredibly grateful.
@item
+@cindex Guerrero, Juan Manuel
+Juan Manuel Guerrero took over maintenance of the DJGPP port.
+
+@item
@cindex Robbins, Arnold
Arnold Robbins
has been working on @command{gawk} since 1988, at first
@@ -39825,7 +39830,7 @@ The people maintaining the various @command{gawk} ports are:
@multitable {MS-Windows with MinGW} {123456789012345678901234567890123456789001234567890}
@item Unix and POSIX systems @tab Arnold Robbins, @EMAIL{arnold@@skeeve.com,arnold at skeeve dot com}
-@c @item MS-DOS with DJGPP @tab Scott Deifik, @EMAIL{scottd.mail@@sbcglobal.net,scottd dot mail at sbcglobal dot net}
+@item MS-DOS with DJGPP @tab Juan Manuel Guerrero, @EMAIL{juan.guerrero@@gmx.de, juan dot guerrero at gmx dot de}
@item MS-Windows with MinGW @tab Eli Zaretskii, @EMAIL{eliz@@gnu.org,eliz at gnu dot org}
@@ -39842,9 +39847,12 @@ The people maintaining the various @command{gawk} ports are:
If your bug is also reproducible under Unix, send a copy of your
report to the @EMAIL{bug-gawk@@gnu.org,bug-gawk at gnu dot org} email list as well.
-The DJGPP port is no longer supported; it will remain in the code base for a while in case
-a volunteer wishes to take it over. If this does not happen, then eventually code for this
-port will be removed.
+@c 7/2017, Juan Guerrero has taken over the DJGPP port.
+@ignore
+The DJGPP port is no longer supported; it will remain in the code base
+for a while in case a volunteer wishes to take it over. If this does
+not happen, then eventually code for this port will be removed.
+@end ignore
@node Other Versions
@appendixsec Other Freely Available @command{awk} Implementations
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 76e91b31..5b6d56bf 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -37380,6 +37380,7 @@ Juan Grigera
provided a port to Windows32 systems.
(This is no longer supported.)
+
@item
@cindex Hankerson, Darrel
For many years,
@@ -37520,6 +37521,10 @@ Antonio Giovanni Colombo rewrote a number of examples in the early
chapters that were severely dated, for which I am incredibly grateful.
@item
+@cindex Guerrero, Juan Manuel
+Juan Manuel Guerrero took over maintenance of the DJGPP port.
+
+@item
@cindex Robbins, Arnold
Arnold Robbins
has been working on @command{gawk} since 1988, at first
@@ -38839,7 +38844,7 @@ The people maintaining the various @command{gawk} ports are:
@multitable {MS-Windows with MinGW} {123456789012345678901234567890123456789001234567890}
@item Unix and POSIX systems @tab Arnold Robbins, @EMAIL{arnold@@skeeve.com,arnold at skeeve dot com}
-@c @item MS-DOS with DJGPP @tab Scott Deifik, @EMAIL{scottd.mail@@sbcglobal.net,scottd dot mail at sbcglobal dot net}
+@item MS-DOS with DJGPP @tab Juan Manuel Guerrero, @EMAIL{juan.guerrero@@gmx.de, juan dot guerrero at gmx dot de}
@item MS-Windows with MinGW @tab Eli Zaretskii, @EMAIL{eliz@@gnu.org,eliz at gnu dot org}
@@ -38856,9 +38861,12 @@ The people maintaining the various @command{gawk} ports are:
If your bug is also reproducible under Unix, send a copy of your
report to the @EMAIL{bug-gawk@@gnu.org,bug-gawk at gnu dot org} email list as well.
-The DJGPP port is no longer supported; it will remain in the code base for a while in case
-a volunteer wishes to take it over. If this does not happen, then eventually code for this
-port will be removed.
+@c 7/2017, Juan Guerrero has taken over the DJGPP port.
+@ignore
+The DJGPP port is no longer supported; it will remain in the code base
+for a while in case a volunteer wishes to take it over. If this does
+not happen, then eventually code for this port will be removed.
+@end ignore
@node Other Versions
@appendixsec Other Freely Available @command{awk} Implementations
diff --git a/nonposix.h b/nonposix.h
index 9a722dd9..b4f52246 100644
--- a/nonposix.h
+++ b/nonposix.h
@@ -68,3 +68,10 @@ int getpgrp(void);
#if defined(__DJGPP__) || defined(__MINGW32__)
int getppid(void);
#endif
+
+#ifdef __DJGPP__
+/* Prototypes of for Posix functions for which we define replacements
+ in pc/ files. */
+wint_t btowc (int c);
+wint_t putwc (wchar_t wc, FILE *stream);
+#endif
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 6300257c..4d4c9f19 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,13 @@
+2017-08-01 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ Bring DJGPP support up to speed.
+
+ * Makefile: Add LOCALEDIR, infodir, mandir. Revise prefix,
+ SHLIBExT, CFLAGS.
+ * config.sed: Update for DJGPP.
+ * gawkmisc.pc: Update for DJGPP.
+ (putwc): New funcction.
+
2017-01-21 Arnold D. Robbins <arnold@skeeve.com>
* gawkmisc.pc: Fix a typo.
diff --git a/pc/Makefile b/pc/Makefile
index 921f320a..f91e9748 100644
--- a/pc/Makefile
+++ b/pc/Makefile
@@ -81,7 +81,10 @@ prefix = c:/gnu
pkgdatadir = $(prefix)/lib/awk
pkgextensiondir = $(prefix)/lib/gawk
DEFLIBPATH = "\"$(pkgextensiondir)\""
+LOCALEDIR="\"$(prefix)/share/locale\""
SHLIBEXT = "\"dll\""
+infodir = $(prefix)/share/info
+mandir = $(prefix)/share/man
#
# Define the install method. Method 1 is Unix-like (and requires cat
# and cp); method 2 uses gawk and batch files.
@@ -103,8 +106,9 @@ VPATH = .;./support
#========================================================================
ifneq ($(DJGPP),)
-prefix = $(DJDIR)
+prefix = /dev/env/DJDIR
pkgdatadir = $(prefix)/share/awk
+SHLIBEXT = "\"dxe\""
endif
LDJG = $(CC) $(LF) -o gawk.exe $(LDRSP) $(LF2)
BDJG = stubify -g awk.exe | stubedit awk.exe runfile=gawk
@@ -201,7 +205,7 @@ BIND = EMPTY
PBIND = EMPTY
EMPTY=
-CFLAGS = $(CF) -DGAWK -I. -I./support -DHAVE_CONFIG_H -DDEFLIBPATH=$(DEFLIBPATH) -DSHLIBEXT=$(SHLIBEXT)
+CFLAGS = $(CF) -DGAWK -I. -I./support -DHAVE_CONFIG_H -DDEFLIBPATH=$(DEFLIBPATH) -DSHLIBEXT=$(SHLIBEXT) -DLOCALEDIR=$(LOCALEDIR)
# object files
AWKOBJS1 = array$O builtin$O eval$O field$O floatcomp$O gawkmisc$O io$O main$O
diff --git a/pc/config.sed b/pc/config.sed
index ae2200c6..8eced744 100644
--- a/pc/config.sed
+++ b/pc/config.sed
@@ -51,11 +51,11 @@ s/^#undef HAVE_FMOD *$/#define HAVE_FMOD 1/
#define HAVE_GETADDRINFO 1\
#endif
/^#undef HAVE_INTMAX_T *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_INTMAX_T 1\
#endif
/^#undef HAVE_INTTYPES_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_INTTYPES_H 1\
#endif
/^#undef HAVE_INTTYPES_H_WITH_UINTMAX *$/c\
@@ -63,7 +63,7 @@ s/^#undef HAVE_FMOD *$/#define HAVE_FMOD 1/
#define HAVE_INTTYPES_H_WITH_UINTMAX 1\
#endif
/^#undef HAVE_ISASCII *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_ISASCII 1\
#endif
/^#undef HAVE_ISWCTYPE *$/c\
@@ -83,7 +83,7 @@ s/^#undef HAVE_LIBM *$/#define HAVE_LIBM 1/
/* #undef HAVE_LIBREADLINE */
s/^#undef HAVE_LIMITS_H *$/#define HAVE_LIMITS_H 1/
/^#undef HAVE_LOCALE_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_LOCALE_H 1\
#endif
/^#undef HAVE_LONG_LONG *$/c\
@@ -101,9 +101,13 @@ s/^#undef HAVE_LIMITS_H *$/#define HAVE_LIMITS_H 1/
s/^#undef HAVE_MEMCMP *$/#define HAVE_MEMCMP 1/
s/^#undef HAVE_MEMCPY *$/#define HAVE_MEMCPY 1/
/^#undef HAVE_MEMMOVE *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_MEMMOVE 1\
#endif
+/^#undef HAVE_MEMORY_H *$/c\
+#ifdef __DJGPP__\
+#define HAVE_MEMORY_H 1\
+#endif
s/^#undef HAVE_MEMSET *$/#define HAVE_MEMSET 1/
/^#undef HAVE_MKSTEMP *$/c\
#ifdef __DJGPP__\
@@ -117,11 +121,11 @@ s/^#undef HAVE_MKTIME *$/#define HAVE_MKTIME 1/
#define HAVE_SETENV 1\
#endif
/^#undef HAVE_SETLOCALE *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_SETLOCALE 1\
#endif
/^#undef HAVE_SNPRINTF *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_SNPRINTF 1\
#endif
/^#undef HAVE_SOCKADDR_STORAGE *$/c\
@@ -133,18 +137,30 @@ s/^#undef HAVE_MKTIME *$/#define HAVE_MKTIME 1/
#define HAVE_SOCKETS 1\
#endif
s/^#undef HAVE_STDARG_H *$/#define HAVE_STDARG_H 1/
+/^#undef HAVE_STDBOOL_H *$/c\
+#ifdef __DJGPP__\
+#define HAVE_STDBOOL_H 1\
+#endif
/^#undef HAVE_STDDEF_H *$/c\
#ifdef __GNUC__\
#define HAVE_STDDEF_H 1\
#endif
/^#undef HAVE_STDINT_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_STDINT_H 1\
#endif
/^#undef HAVE_STDLIB_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_STDLIB_H 1\
#endif
+/^#undef HAVE_STRCASECMP *$/c\
+#ifdef __DJGPP__\
+#define HAVE_STRCASECMP 1\
+#endif
+/^#undef HAVE_STRCOLL *$/c\
+#ifdef __DJGPP__\
+#define HAVE_STRCOLL 1\
+#endif
s/^#undef HAVE_STRCHR *$/#define HAVE_STRCHR 1/
s/^#undef HAVE_STRERROR *$/#define HAVE_STRERROR 1/
/^#undef HAVE_STRFTIME *$/c\
@@ -164,16 +180,24 @@ s/^#undef HAVE_STRING_H *$/#define HAVE_STRING_H 1/
#endif
s/^#undef HAVE_STRTOD *$/#define HAVE_STRTOD 1/
/^#undef HAVE_STRTOUL *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_STRTOUL 1\
#endif
+/^#undef HAVE_STRUCT_STAT_ST_BLKSIZE *$/c\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1\
+#endif
+/^#undef HAVE_SYS_IOCTL_H *$/c\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
+#define HAVE_SYS_IOCTL_H 1\
+#endif
s/^#undef HAVE_SYSTEM *$/#define HAVE_SYSTEM 1/
/^#undef HAVE_SYS_PARAM_H *$/c\
-#ifndef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_SYS_PARAM_H 1\
#endif
/^#undef HAVE_SYS_STAT_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_SYS_STAT_H 1\
#endif
/^#undef HAVE_SYS_TIME_H *$/c\
@@ -185,6 +209,10 @@ s/^#undef HAVE_SYS_TYPES_H *$/#define HAVE_SYS_TYPES_H 1/
#ifdef __DJGPP__\
#define HAVE_SYS_WAIT_H 1\
#endif
+/^#undef HAVE_TMPFILE *$/c\
+#ifdef __DJGPP__\
+#define HAVE_TMPFILE 1\
+#endif
/^#undef HAVE_TOWLOWER *$/c\
#ifdef __MINGW32__\
#define HAVE_TOWLOWER 1\
@@ -198,9 +226,6 @@ s/^#undef HAVE_TZSET *$/#define HAVE_TZSET 1/
/^#undef HAVE_UINTMAX_T *$/c\
#if defined(__DJGPP__) || defined(__MINGW32__)\
#define HAVE_UINTMAX_T 1\
-#ifdef __DJGPP__\
-#define uintmax_t unsigned long long\
-#endif\
#endif
/^#undef HAVE_UNISTD_H *$/c\
#if defined(__DJGPP__) || defined(__MINGW32__)\
@@ -240,6 +265,14 @@ s/^#undef HAVE_VPRINTF *$/#define HAVE_VPRINTF 1/
#ifdef __MINGW32__\
#define HAVE_WINT_T 1\
#endif
+/^#undef HAVE__BOOL *$/c\
+#ifdef __DJGPP__\
+#define HAVE__BOOL 1\
+#endif
+/^#undef PRINTF_HAS_F_FORMAT *$/c\
+#ifdef __DJGPP__\
+#define PRINTF_HAS_F_FORMAT 1\
+#endif
s/^#undef PROTOTYPES *$/#define PROTOTYPES 1/
s/^#undef RETSIGTYPE *$/#define RETSIGTYPE void/
/^#.*RETSIGTYPE /a\
@@ -255,40 +288,26 @@ s/^#undef TIME_WITH_SYS_TIME *$/#define TIME_WITH_SYS_TIME 1/
#ifdef __GNUC__\
#define inline __inline__\
#endif
-/^#undef intmax_t *$/c\
-#ifdef __DJGPP__\
-#define intmax_t long long\
-#endif
-/^#undef restrict *$/c\
-#ifdef __DJGPP__\
-#define restrict\
-#endif
-/^#undef uintmax_t *$/c\
-#ifdef __DJGPP__\
-#define uintmax_t unsigned long long\
-#endif
s|^#undef PACKAGE_URL *$|#define PACKAGE_URL "http://www.gnu.org/software/gawk/"|
$a\
+#ifdef __DJGPP__\
+/* gcc no longer includes this by default */\
+# include <sys/version.h>\
+\
/* Library search path */\
-#if defined(__DJGPP__) && (__DJGPP__ > 2 || __DJGPP_MINOR__ >= 3)\
-# define DEFPATH ".;/dev/env/DJDIR/share/awk"\
-#else\
-# define DEFPATH ".;c:/lib/awk;c:/gnu/lib/awk"\
+# if (__DJGPP__ > 2 || __DJGPP_MINOR__ >= 3)\
+# define DEFPATH ".;/dev/env/DJDIR/share/awk"\
+# else\
+# define DEFPATH ".;c:/lib/awk;c:/gnu/lib/awk"\
+# endif\
#endif\
\
#ifndef __DJGPP__\
#define HAVE_POPEN_H 1\
#endif\
\
-#if defined(__DJGPP__)\
-typedef unsigned int uint32_t;\
-typedef int int32_t;\
-#define INT32_MAX INT_MAX\
-#define INT32_MIN INT_MIN\
-#endif\
-\
#if defined(__EMX__)\
#define strcasecmp stricmp\
#define strncasecmp strnicmp\
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index c6c92a46..41ffd5ec 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -299,6 +299,7 @@ os_is_setuid()
#ifdef __DJGPP__
#include <sys/exceptn.h>
+#include <io.h>
#endif
static int orig_tty_mode = -1;
@@ -996,6 +997,7 @@ init_sockets(void)
#ifdef __DJGPP__
+# if __DJGPP__ == 2 && __DJGPP_MINOR__ < 4
int
unsetenv (const char *name)
{
@@ -1004,6 +1006,7 @@ unsetenv (const char *name)
return putenv (name);
}
+#endif
/* This is needed to defeat too-clever GCC warnings in dfa.c about
comparison being always false due to limited range of data type. */
@@ -1013,4 +1016,11 @@ btowc (int c)
return c;
}
+wint_t
+putwc(wchar_t wc, FILE *stream)
+{
+ return MB_CUR_MAX == 1 && wc > 0 && wc <= UCHAR_MAX
+ && putc((unsigned char)wc, stream) != EOF ? (wint_t)wc : WEOF;
+}
+
#endif /* __DJGPP__ */