diff options
-rwxr-xr-x | ChangeLog | 2 | ||||
-rw-r--r-- | ext.c | 38 | ||||
-rw-r--r-- | pc/ChangeLog | 8 | ||||
-rw-r--r-- | pc/config.sed | 8 | ||||
-rw-r--r-- | pc/gawkmisc.pc | 15 |
5 files changed, 50 insertions, 21 deletions
@@ -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> @@ -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) |