gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, master, updated. 99290f5ca37cb905f7f1dab


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. 99290f5ca37cb905f7f1dab9be416b2e2057d243
Date: Thu, 13 Sep 2012 14:29:12 +0000

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, master has been updated
       via  99290f5ca37cb905f7f1dab9be416b2e2057d243 (commit)
      from  c2db2b9ff8465cb5044e6f22beb229336479be57 (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=99290f5ca37cb905f7f1dab9be416b2e2057d243

commit 99290f5ca37cb905f7f1dab9be416b2e2057d243
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Sep 13 17:27:53 2012 +0300

    z/OS changes from Dave Pitts and Arnold.

diff --git a/ChangeLog b/ChangeLog
index fa0f499..2598c30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-09-13         Arnold D. Robbins     <address@hidden>
+
+       * configure.ac: Determination of DYNAMIC adjusted. Hopefully is
+       smarter for z/OS.
+
+2012-09-13         Dave Pitts            <address@hidden>
+
+       * awk.h: Add defines for z/OS for newer types.
+
 2012-08-31         Arnold D. Robbins     <address@hidden>
 
        * gawkapi.c: Wrap various bits in #ifdef DYNAMIC so that
diff --git a/awk.h b/awk.h
index d106d2e..de42529 100644
--- a/awk.h
+++ b/awk.h
@@ -117,6 +117,16 @@ extern int errno;
 #if HAVE_STDINT_H
 # include <stdint.h>
 #endif
+#else /* ZOS_USS */
+#include <limits.h>
+#include <sys/time.h>
+#define INT32_MAX INT_MAX
+#define INT32_MIN INT_MIN
+#ifndef __uint32_t
+#define __uint32_t 1
+typedef  unsigned long uint32_t;
+#endif
+typedef  long int32_t;
 #endif /* !ZOS_USS */
 
 /* ----------------- System dependencies (with more includes) -----------*/
@@ -1638,7 +1648,7 @@ extern const wchar_t *wstrstr(const wchar_t *haystack, 
size_t hs_len,
 extern const wchar_t *wcasestrstr(const wchar_t *haystack, size_t hs_len,
                const wchar_t *needle, size_t needle_len);
 extern void r_free_wstr(NODE *n);
-#define free_wstr(n)   (((n)->flags & WSTRCUR) ? r_free_wstr(n) : 0)
+#define free_wstr(n)   do { if ((n)->flags & WSTRCUR) r_free_wstr(n); } 
while(0)
 extern wint_t btowc_cache[];
 #define btowc_cache(x) btowc_cache[(x)&0xFF]
 extern void init_btowc_cache();
diff --git a/configure b/configure
index 4125827..fd9b152 100755
--- a/configure
+++ b/configure
@@ -10018,9 +10018,6 @@ $as_echo "#define HAVE_MBRTOWC 1" >>confdefs.h
 ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" 
"$ac_includes_default"
 if test "x$ac_cv_header_dlfcn_h" = xyes; then :
 
-$as_echo "#define DYNAMIC 1" >>confdefs.h
-
-
        # Check this separately. Some systems have dlopen
        # in libc. Notably freebsd and cygwin.
        # HP-NSK has it in zrldsrl
@@ -10077,9 +10074,19 @@ $as_echo "$ac_cv_search_dlopen" >&6; }
 ac_res=$ac_cv_search_dlopen
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
+  gawk_have_dlopen=yes
+else
+  gawk_have_dlopen=no
 fi
 
+       # Only do DYNAMIC if we have the lip. z/OS (some versions) have
+       # the header but not the lib, apparently
+       if test "$gawk_have_dlopen" = yes
+       then
+
+$as_echo "#define DYNAMIC 1" >>confdefs.h
+
+       fi
 
 fi
 
diff --git a/configure.ac b/configure.ac
index bb81f80..575b3da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -285,12 +285,17 @@ AC_FUNC_MBRTOWC
 dnl check for dynamic linking
 dnl This is known to be very primitive
 AC_CHECK_HEADER(dlfcn.h,
-       [AC_DEFINE([DYNAMIC], 1, [dynamic loading is possible])
-
+       [
        # Check this separately. Some systems have dlopen
        # in libc. Notably freebsd and cygwin.
        # HP-NSK has it in zrldsrl
-       AC_SEARCH_LIBS(dlopen, dl zrldsrl)
+       AC_SEARCH_LIBS(dlopen, dl zrldsrl, gawk_have_dlopen=yes, 
gawk_have_dlopen=no)
+       # Only do DYNAMIC if we have the lip. z/OS (some versions) have
+       # the header but not the lib, apparently
+       if test "$gawk_have_dlopen" = yes
+       then
+               AC_DEFINE([DYNAMIC], 1, [dynamic loading is possible])
+       fi
 ])
 
 dnl check for how to use getpgrp
diff --git a/extension/ChangeLog b/extension/ChangeLog
index e37715a..1a32961 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,10 @@
+2012-09-13         Dave Pitts            <address@hidden>
+
+       * gawkfts.c: Add defines and ifdefs for z/OS.
+       * gawkfts.h: Add defines and ifdefs for z/OS. Fix // comments.
+       * readdir.c (dir_get_record): Adjust sprintf format for z/OS.
+       * rwarray.c: Add defines and ifdefs for z/OS. Fix // comments.
+
 2012-09-11         Arnold D. Robbins     <address@hidden>
 
        * readdir.c (do_readdir_do_ftype): Set ERRNO for bad arguments.
diff --git a/extension/gawkfts.c b/extension/gawkfts.c
index 2f46595..2b47275 100644
--- a/extension/gawkfts.c
+++ b/extension/gawkfts.c
@@ -40,7 +40,12 @@ static char sccsid[] = "@(#)fts.c    8.6 (Berkeley) 8/14/94";
 #endif
 
 /* #include "namespace.h" */
+#ifndef ZOS_USS
 #include <sys/param.h>
+#else
+#include <stdio.h>
+#include <limits.h>
+#endif /* ZOS_USS */
 #include <sys/stat.h>
 
 #include <assert.h>
diff --git a/extension/gawkfts.h b/extension/gawkfts.h
index 4110966..f1ca26f 100644
--- a/extension/gawkfts.h
+++ b/extension/gawkfts.h
@@ -45,6 +45,11 @@
 # endif
 #endif
 
+#ifdef ZOS_USS
+#include <limits.h>
+#define MAXPATHLEN FILENAME_MAX
+#endif
+
 typedef struct {
        struct _ftsent *fts_cur;        /* current node */
        struct _ftsent *fts_child;      /* linked list of children */
@@ -64,7 +69,7 @@ typedef struct {
 #define        FTS_PHYSICAL    0x010           /* physical walk */
 #define        FTS_SEEDOT      0x020           /* return dot and dot-dot */
 #define        FTS_XDEV        0x040           /* don't cross devices */
-// #define     FTS_WHITEOUT    0x080           /* return whiteout information 
*/
+/* #define     FTS_WHITEOUT    0x080 */        /* return whiteout information 
*/
 #define        FTS_OPTIONMASK  0x0ff           /* valid user option mask */
 
 #define        FTS_NAMEONLY    0x100           /* (private) child names only */
@@ -76,7 +81,11 @@ typedef struct _ftsent {
        struct _ftsent *fts_cycle;      /* cycle node */
        struct _ftsent *fts_parent;     /* parent directory */
        struct _ftsent *fts_link;       /* next file in directory */
+#ifdef ZOS_USS
+       long fts_number;                /* local numeric value */
+#else
        long long fts_number;      /* local numeric value */
+#endif
        void *fts_pointer;              /* local address value */
        char *fts_accpath;              /* access path */
        char *fts_path;                 /* root path */
diff --git a/extension/readdir.c b/extension/readdir.c
index 7140b72..5f937fb 100644
--- a/extension/readdir.c
+++ b/extension/readdir.c
@@ -175,9 +175,15 @@ dir_get_record(char **out, struct iobuf_public *iobuf, int 
*errcode,
                return EOF;
        }
 
+#ifdef ZOS_USS
+       len = sprintf(the_dir->buf, "%lu/%s",
+                       (unsigned long) dirent->d_ino,
+                       dirent->d_name);
+#else
        len = sprintf(the_dir->buf, "%llu/%s",
                        (unsigned long long) dirent->d_ino,
                        dirent->d_name);
+#endif
 
        if (do_ftype != NEVER_DO_INFO) {
                const char *ftstr = ftype(dirent);
diff --git a/extension/rwarray.c b/extension/rwarray.c
index d8a54fd..4311828 100644
--- a/extension/rwarray.c
+++ b/extension/rwarray.c
@@ -49,6 +49,17 @@
 #define _(msgid)  gettext(msgid)
 #define N_(msgid) msgid
 
+#if defined(ZOS_USS)
+#include <limits.h>
+#define INT32_MAX INT_MAX
+#define INT32_MIN INT_MIN
+#ifndef __uint32_t
+#define __uint32_t 1
+typedef  unsigned long uint32_t;
+#endif
+typedef  long int32_t;
+#endif /* ZOS_USS */
+
 #define MAGIC "awkrulz\n"
 #define MAJOR 3
 #define MINOR 0
@@ -388,11 +399,11 @@ read_elem(FILE *fp, awk_element_t *element)
 
        if (index_len > 0) {
                if (buffer == NULL) {
-                       // allocate buffer
+                       /* allocate buffer */
                        emalloc(buffer, char *, index_len, "read_elem");
                        buflen = index_len;
                } else if (buflen < index_len) {
-                       // reallocate buffer
+                       /* reallocate buffer */
                        char *cp = realloc(buffer, index_len);
 
                        if (cp == NULL)
diff --git a/missing_d/ChangeLog b/missing_d/ChangeLog
index ff29a92..cb79747 100644
--- a/missing_d/ChangeLog
+++ b/missing_d/ChangeLog
@@ -1,3 +1,7 @@
+2012-09-13         Arnold D. Robbins     <address@hidden>
+
+       * snprintf.c, strtoul.c: Remove TRUE/FALSE in favor of true/false.
+
 2012-05-04         Arnold D. Robbins     <address@hidden>
 
        * snprintf.c [DJGPP]: Change to __DJGPP__.
diff --git a/missing_d/snprintf.c b/missing_d/snprintf.c
index 12e5092..6cee2be 100644
--- a/missing_d/snprintf.c
+++ b/missing_d/snprintf.c
@@ -53,14 +53,14 @@ static void close_safe_f()
 static FILE *
 safe_tmpfile (void)
 {
-       static short first = TRUE;
+       static bool first = true;
        static const char template[] = "snprintfXXXXXX";
        int fd;
        static char *tmpdir = NULL;
        static int len = 0;
 
        if (first) {
-               first = FALSE;
+               first = false;
                /*
                 * First try Unix stanadard env var, then Windows var,
                 * then fall back to /tmp.
diff --git a/missing_d/strtoul.c b/missing_d/strtoul.c
index d265575..cdd7cf1 100644
--- a/missing_d/strtoul.c
+++ b/missing_d/strtoul.c
@@ -14,8 +14,6 @@
 #include <string.h>
 #include <errno.h>
 #include <limits.h>
-#define TRUE 1
-#define FALSE 0
 #define strtoul mystrtoul
 #endif
 
@@ -33,10 +31,10 @@ int base;
 
        unsigned long result = 0UL;
        char *nptr_orig = (char *) nptr;
-       int neg = FALSE;
+       bool neg = false;
        char *cp, c;
        int val;
-       int sawdigs = FALSE;
+       bool sawdigs = false;
 
        /*
         * The strtoul() function converts the initial part of the
@@ -64,7 +62,7 @@ int base;
                nptr++;
        else if (*nptr == '-') {
                nptr++;
-               neg = TRUE;
+               neg = true;
        }
 
        /*
@@ -110,7 +108,7 @@ int base;
                                goto out;
                        result *= base;
                        result += val;
-                       sawdigs = TRUE;
+                       sawdigs = true;
                        break;
                case 'A': case 'B': case 'C': case 'D': case 'E':
                case 'F': case 'G': case 'H': case 'I': case 'J':
@@ -133,7 +131,7 @@ int base;
                                goto out;
                        result *= base;
                        result += val;
-                       sawdigs = TRUE;
+                       sawdigs = true;
                        break;
                default:
                        goto out;

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

Summary of changes:
 ChangeLog            |    9 +++++++++
 awk.h                |   12 +++++++++++-
 configure            |   15 +++++++++++----
 configure.ac         |   11 ++++++++---
 extension/ChangeLog  |    7 +++++++
 extension/gawkfts.c  |    5 +++++
 extension/gawkfts.h  |   11 ++++++++++-
 extension/readdir.c  |    6 ++++++
 extension/rwarray.c  |   15 +++++++++++++--
 missing_d/ChangeLog  |    4 ++++
 missing_d/snprintf.c |    4 ++--
 missing_d/strtoul.c  |   12 +++++-------
 12 files changed, 91 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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