aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2019-02-04 21:12:51 +0200
committerArnold D. Robbins <arnold@skeeve.com>2019-02-04 21:12:51 +0200
commitb878ecd5d8ff1587adb72187187a40945c87b233 (patch)
tree11c05a3080b9724a04ab5c7c829e8350e7a72a5d
parentfb0b9cacebb6dcbbd09bdc491156bf4bd0d2022e (diff)
downloadegawk-b878ecd5d8ff1587adb72187187a40945c87b233.tar.gz
egawk-b878ecd5d8ff1587adb72187187a40945c87b233.tar.bz2
egawk-b878ecd5d8ff1587adb72187187a40945c87b233.zip
Updates for DJGPP.
-rwxr-xr-xChangeLog2
-rw-r--r--ext.c38
-rw-r--r--pc/ChangeLog8
-rw-r--r--pc/config.sed8
-rw-r--r--pc/gawkmisc.pc15
5 files changed, 50 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 1a2ffa19..94cdc0c4 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
* NEWS.1: Rotated in from NEWS.
* NEWS: Shortened to start over again with 5.0 changes.
+ * ext.c (is_valid_identifier): Move outside of ifdefs so that
+ DJGPP (and other code) can find it.
2019-02-03 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/ext.c b/ext.c
index 8babd2c0..c0ecd6bf 100644
--- a/ext.c
+++ b/ext.c
@@ -77,25 +77,6 @@ load_ext(const char *lib_name)
lib_name, INIT_FUNC);
}
-/* is_valid_identifier --- return true if name is a valid simple identifier */
-
-bool
-is_valid_identifier(const char *name)
-{
- const char *sp = name;
- int c;
-
- if (! is_letter(*sp))
- return false;
-
- for (sp++; (c = *sp++) != '\0';) {
- if (! is_identchar(c))
- return false;
- }
-
- return true;
-}
-
/* make_builtin --- register name to be called as func with a builtin body */
awk_bool_t
@@ -266,3 +247,22 @@ close_extensions()
if (s->stype == SRC_EXTLIB && s->fini_func)
(*s->fini_func)();
}
+
+/* is_valid_identifier --- return true if name is a valid simple identifier */
+
+bool
+is_valid_identifier(const char *name)
+{
+ const char *sp = name;
+ int c;
+
+ if (! is_letter(*sp))
+ return false;
+
+ for (sp++; (c = *sp++) != '\0';) {
+ if (! is_identchar(c))
+ return false;
+ }
+
+ return true;
+}
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 18bbbf15..10f0101c 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,11 @@
+2010-02-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ * config.sed (_GNU_SOURCE) [__DJGPP__]: Define for DJGPP.
+ (HAVE_LANGINFO_CODESET) [__DJGPP__]: Define for DJGPP.
+ [__DJGPP__]: Prototype of is_valid_identifier.
+
+ * gawkmisc.pc (nl_langinfo) [__DJGPP__]: New function.
+
2019-02-02 Eli Zaretskii <eliz@gnu.org>
* gawkmisc.pc (w32_execvp) [__MINGW32__]: Renamed from execvp, to
diff --git a/pc/config.sed b/pc/config.sed
index 840feab6..45f0287d 100644
--- a/pc/config.sed
+++ b/pc/config.sed
@@ -83,7 +83,7 @@ s/^#undef HAVE_FMOD *$/#define HAVE_FMOD 1/
#define HAVE_ISWUPPER 1\
#endif
/^#undef HAVE_LANGINFO_CODESET *$/c\
-#ifdef __MINGW32__\
+#if defined(__DJGPP__) || defined(__MINGW32__)\
#define HAVE_LANGINFO_CODESET 1\
#endif
s/^#undef HAVE_LIBM *$/#define HAVE_LIBM 1/
@@ -301,7 +301,7 @@ s/^#undef TIME_WITH_SYS_TIME *$/#define TIME_WITH_SYS_TIME 1/
/^\/\* Enable extensions on AIX 3, Interix. \*\//i\
/* This is required to compile Gnulib regex code. */\
-#ifdef __MINGW32__\
+#if defined(__DJGPP__) || defined(__MINGW32__)\
#define _GNU_SOURCE 1\
#endif
@@ -318,6 +318,10 @@ $a\
# else\
# define DEFPATH ".;c:/lib/awk;c:/gnu/lib/awk"\
# endif\
+\
+/* Function prototype. */\
+#include <stdbool.h>\
+extern bool is_valid_identifier(const char *name);\
#endif\
\
#ifndef __DJGPP__\
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index 2e581011..e0f3f3ff 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -1108,6 +1108,21 @@ init_sockets(void)
#ifdef __DJGPP__
+/* Replacement for the missing nl_langinfo. DJGPP provides only C locale. */
+#include <langinfo.h>
+
+char *
+nl_langinfo (int item)
+{
+ switch (item)
+ {
+ case CODESET:
+ default:
+ return (char *) "";
+ }
+}
+
+
# if __DJGPP__ == 2 && __DJGPP_MINOR__ < 4
int
unsetenv (const char *name)