gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, gawk-4.2-stable, updated. gawk-4.1.0-282


From: Eli Zaretskii
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.2-stable, updated. gawk-4.1.0-2820-g73a0bda
Date: Sat, 21 Oct 2017 06:51:53 -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, gawk-4.2-stable has been updated
       via  73a0bda71873bdc095f171d3d8bf322b974a010d (commit)
      from  23e8672e421a46f13f9f7b577f6f9e8e5889dd75 (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=73a0bda71873bdc095f171d3d8bf322b974a010d

commit 73a0bda71873bdc095f171d3d8bf322b974a010d
Author: KO Myung-Hun <address@hidden>
Date:   Sat Oct 21 13:51:11 2017 +0300

    Fix the OS/2 build.

diff --git a/ChangeLog b/ChangeLog
index 21da510..1b4234e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-10-21  KO Myung-Hun <address@hidden>
+
+       * nonposix.h [__KLIBC__]: Include dlfcn.h, declare os2_dlsym, and
+       redirect dlsym to os2_dlsym. Declare os2_fixdllname.  Declare
+       os2_dlopen and redirect dlopen to os2_dlopen.
+       * io.h (find_source) [__EMX__]: Truncate extension file basename
+       to 8 characters.
+
 2017-10-19         Arnold D. Robbins     <address@hidden>
 
        * 4.2.0: Release tar ball made.
diff --git a/io.c b/io.c
index 378b115..7314d8e 100644
--- a/io.c
+++ b/io.c
@@ -2913,6 +2913,12 @@ find_source(const char *src, struct stat *stb, int 
*errcode, int is_extlib)
        *errcode = 0;
        if (src == NULL || *src == '\0')
                return NULL;
+#ifdef __EMX__
+       char os2_src[strlen(src) + 1];
+
+       if (is_extlib)
+               src = os2_fixdllname(os2_src, src, sizeof(os2_src));
+#endif /* __EMX__ */
        path = do_find_source(src, stb, errcode, pi);
 
        if (path == NULL && is_extlib) {
diff --git a/nonposix.h b/nonposix.h
index b4f5224..19336ee 100644
--- a/nonposix.h
+++ b/nonposix.h
@@ -75,3 +75,19 @@ int getppid(void);
 wint_t btowc (int c);
 wint_t putwc (wchar_t wc, FILE *stream);
 #endif
+
+#ifdef __EMX__
+
+char *os2_fixdllname(char *dst, const char *src, size_t n);
+
+#ifdef __KLIBC__
+#include <dlfcn.h>
+
+#define dlopen(f, m) os2_dlopen(f, m)
+void *os2_dlopen(const char *file, int mode);
+
+#define dlsym(h, n) os2_dlsym(h, n)
+void *os2_dlsym(void *handle, const char *name);
+#endif /* __KLIBC__ */
+
+#endif /* __EMX__ */
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 9f0f027..800e679 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-21  KO Myung-Hun <address@hidden>
+
+       * gawkmisc.pc (os2_dlsym, os2_fixdllname, os2_dlopen) [__KLIBC__]:
+       New functions.
+
 2017-10-21  Eli Zaretskii  <address@hidden>
 
        * Makefile (install1): Create include/ at desctination, and copy
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index 41ffd5e..1d845cc 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -548,6 +548,52 @@ _os2_unixroot_path(const char *path)
 
   return (result) ? (const char*) result : path;
 }
+
+/* limit a length of DLL name up to 8 characters. If dst is not enough for
+   a fixed dll name, it is truncated. */
+char *os2_fixdllname(char *dst, const char *src, size_t n)
+{
+    char drive[_MAX_DRIVE];
+    char dir[_MAX_DIR];
+    char name[_MAX_FNAME];
+    char ext[_MAX_EXT];
+    char dll_file[_MAX_PATH];
+
+    _splitpath(src, drive, dir, name, ext);
+    if (strlen(name) > 8)
+        name[8] = '\0';
+    _makepath(dll_file, drive, dir, name, ext);
+
+    strncpy(dst, dll_file, n);
+    dst[n - 1] = '\0';
+
+    return dst;
+}
+
+#ifdef __KLIBC__
+
+/* replacement of dlopen(). This limits a length of a base name up to 8
+   characters. */
+void *os2_dlopen(const char *file, int mode)
+{
+    char dll_file[strlen(file) + 1];
+
+    return (dlopen)(os2_fixdllname(dll_file, file, sizeof(dll_file)), mode);
+}
+
+/* replacement of dlsym(). This prepends '_' to name. */
+void *os2_dlsym(void *handle, const char *name)
+{
+    char sym[strlen(name) + 1 + 1]; /* 1 for '_', 1 for NUL */
+
+    sym[0] = '_';
+    strcpy(sym + 1, name);
+
+    return (dlsym)(handle, sym);
+}
+
+#endif /* __KLIBC__ */
+
 #endif /* __EMX__ */
 
 #ifdef __MINGW32__

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog      |  8 ++++++++
 io.c           |  6 ++++++
 nonposix.h     | 16 ++++++++++++++++
 pc/ChangeLog   |  5 +++++
 pc/gawkmisc.pc | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 81 insertions(+)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]