aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-08-01 22:58:00 +0300
committerArnold D. Robbins <arnold@skeeve.com>2017-08-09 22:13:32 +0300
commit5557a45fbe813ba13eda8b78a16f84621a9794ee (patch)
treefa9f763383e65d13de2827c0d45f132185906fb8
parentc51a97fc72b732d19dbc83a7a4aadf9893a92b78 (diff)
downloadegawk-5557a45fbe813ba13eda8b78a16f84621a9794ee.tar.gz
egawk-5557a45fbe813ba13eda8b78a16f84621a9794ee.tar.bz2
egawk-5557a45fbe813ba13eda8b78a16f84621a9794ee.zip
Initial additions to update DJGPP port.
-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 3a05ca56..d890a281 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,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 b28f4653..74c8ab2f 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 0ebbb091..7bb6f916 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 41b10fda..10b146d7 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -28356,6 +28356,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.
@@ -29469,6 +29471,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>
@@ -29481,10 +29485,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
@@ -34376,6 +34376,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)
@@ -35215,7 +35216,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)
@@ -36270,68 +36271,68 @@ Ref: Ranges and Locales-Footnote-11139250
Ref: Ranges and Locales-Footnote-21139277
Ref: Ranges and Locales-Footnote-31139512
Node: Contributors1139733
-Node: History summary1145293
-Node: Installation1146673
-Node: Gawk Distribution1147617
-Node: Getting1148101
-Node: Extracting1149062
-Node: Distribution contents1150700
-Node: Unix Installation1157042
-Node: Quick Installation1157724
-Node: Shell Startup Files1160138
-Node: Additional Configuration Options1161227
-Node: Configuration Philosophy1163216
-Node: Non-Unix Installation1165585
-Node: PC Installation1166045
-Node: PC Binary Installation1166883
-Node: PC Compiling1167318
-Node: PC Using1168435
-Node: Cygwin1171480
-Node: MSYS1172250
-Node: VMS Installation1172751
-Node: VMS Compilation1173542
-Ref: VMS Compilation-Footnote-11174771
-Node: VMS Dynamic Extensions1174829
-Node: VMS Installation Details1176514
-Node: VMS Running1178767
-Node: VMS GNV1183046
-Node: VMS Old Gawk1183781
-Node: Bugs1184252
-Node: Bug address1184915
-Node: Usenet1187312
-Node: Maintainers1188089
-Node: Other Versions1189465
-Node: Installation summary1196049
-Node: Notes1197084
-Node: Compatibility Mode1197949
-Node: Additions1198731
-Node: Accessing The Source1199656
-Node: Adding Code1201091
-Node: New Ports1207309
-Node: Derived Files1211797
-Ref: Derived Files-Footnote-11217282
-Ref: Derived Files-Footnote-21217317
-Ref: Derived Files-Footnote-31217915
-Node: Future Extensions1218029
-Node: Implementation Limitations1218687
-Node: Extension Design1219870
-Node: Old Extension Problems1221024
-Ref: Old Extension Problems-Footnote-11222542
-Node: Extension New Mechanism Goals1222599
-Ref: Extension New Mechanism Goals-Footnote-11225963
-Node: Extension Other Design Decisions1226152
-Node: Extension Future Growth1228265
-Node: Old Extension Mechanism1229101
-Node: Notes summary1230864
-Node: Basic Concepts1232046
-Node: Basic High Level1232727
-Ref: figure-general-flow1233009
-Ref: figure-process-flow1233694
-Ref: Basic High Level-Footnote-11236995
-Node: Basic Data Typing1237180
-Node: Glossary1240508
-Node: Copying1272455
-Node: GNU Free Documentation License1309994
-Node: Index1335112
+Node: History summary1145361
+Node: Installation1146741
+Node: Gawk Distribution1147685
+Node: Getting1148169
+Node: Extracting1149130
+Node: Distribution contents1150768
+Node: Unix Installation1157110
+Node: Quick Installation1157792
+Node: Shell Startup Files1160206
+Node: Additional Configuration Options1161295
+Node: Configuration Philosophy1163284
+Node: Non-Unix Installation1165653
+Node: PC Installation1166113
+Node: PC Binary Installation1166951
+Node: PC Compiling1167386
+Node: PC Using1168503
+Node: Cygwin1171548
+Node: MSYS1172318
+Node: VMS Installation1172819
+Node: VMS Compilation1173610
+Ref: VMS Compilation-Footnote-11174839
+Node: VMS Dynamic Extensions1174897
+Node: VMS Installation Details1176582
+Node: VMS Running1178835
+Node: VMS GNV1183114
+Node: VMS Old Gawk1183849
+Node: Bugs1184320
+Node: Bug address1184983
+Node: Usenet1187380
+Node: Maintainers1188157
+Node: Other Versions1189418
+Node: Installation summary1196002
+Node: Notes1197037
+Node: Compatibility Mode1197902
+Node: Additions1198684
+Node: Accessing The Source1199609
+Node: Adding Code1201044
+Node: New Ports1207262
+Node: Derived Files1211750
+Ref: Derived Files-Footnote-11217235
+Ref: Derived Files-Footnote-21217270
+Ref: Derived Files-Footnote-31217868
+Node: Future Extensions1217982
+Node: Implementation Limitations1218640
+Node: Extension Design1219823
+Node: Old Extension Problems1220977
+Ref: Old Extension Problems-Footnote-11222495
+Node: Extension New Mechanism Goals1222552
+Ref: Extension New Mechanism Goals-Footnote-11225916
+Node: Extension Other Design Decisions1226105
+Node: Extension Future Growth1228218
+Node: Old Extension Mechanism1229054
+Node: Notes summary1230817
+Node: Basic Concepts1231999
+Node: Basic High Level1232680
+Ref: figure-general-flow1232962
+Ref: figure-process-flow1233647
+Ref: Basic High Level-Footnote-11236948
+Node: Basic Data Typing1237133
+Node: Glossary1240461
+Node: Copying1272408
+Node: GNU Free Documentation License1309947
+Node: Index1335065

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 66312691..c710ea6a 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -38354,6 +38354,7 @@ Juan Grigera
provided a port to Windows32 systems.
(This is no longer supported.)
+
@item
@cindex Hankerson, Darrel
For many years,
@@ -38494,6 +38495,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
@@ -39813,7 +39818,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}
@@ -39830,9 +39835,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 f7d396bf..5757c857 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -37368,6 +37368,7 @@ Juan Grigera
provided a port to Windows32 systems.
(This is no longer supported.)
+
@item
@cindex Hankerson, Darrel
For many years,
@@ -37508,6 +37509,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
@@ -38827,7 +38832,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}
@@ -38844,9 +38849,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__ */