emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master ee7514b: Update from Gnulib


From: Paul Eggert
Subject: [Emacs-diffs] master ee7514b: Update from Gnulib
Date: Thu, 27 Dec 2018 14:45:51 -0500 (EST)

branch: master
commit ee7514b91beb254a7dc62f618046d34036555cea
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Update from Gnulib
    
    * build-aux/config.guess, lib/regcomp.c, lib/regex.c:
    * lib/regex_internal.h, lib/regexec.c: Copy from Gnulib.
---
 build-aux/config.guess | 23 ++++++++++++++---------
 lib/regcomp.c          | 16 ++--------------
 lib/regex.c            |  4 ++--
 lib/regex_internal.h   | 12 +-----------
 lib/regexec.c          |  6 +++---
 5 files changed, 22 insertions(+), 39 deletions(-)

diff --git a/build-aux/config.guess b/build-aux/config.guess
index 94c4ac1..28bec27 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -391,15 +391,20 @@ case 
"$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        echo i386-pc-auroraux"$UNAME_RELEASE"
        exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-       UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
-       case `isainfo -b` in
-           32)
-               echo i386-pc-solaris2"$UNAME_REL"
-               ;;
-           64)
-               echo x86_64-pc-solaris2"$UNAME_REL"
-               ;;
-       esac
+       set_cc_for_build
+       SUN_ARCH=i386
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH=x86_64
+           fi
+       fi
+       echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
diff --git a/lib/regcomp.c b/lib/regcomp.c
index 0b05a63..2672ffc 100644
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -233,9 +233,7 @@ re_compile_pattern (const char *pattern, size_t length,
     return NULL;
   return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]);
 }
-#ifdef _LIBC
 weak_alias (__re_compile_pattern, re_compile_pattern)
-#endif
 
 /* Set by 're_set_syntax' to the current regexp syntax to recognize.  Can
    also be assigned to arbitrarily: each pattern buffer stores its own
@@ -260,9 +258,7 @@ re_set_syntax (reg_syntax_t syntax)
   re_syntax_options = syntax;
   return ret;
 }
-#ifdef _LIBC
 weak_alias (__re_set_syntax, re_set_syntax)
-#endif
 
 int
 re_compile_fastmap (struct re_pattern_buffer *bufp)
@@ -281,9 +277,7 @@ re_compile_fastmap (struct re_pattern_buffer *bufp)
   bufp->fastmap_accurate = 1;
   return 0;
 }
-#ifdef _LIBC
 weak_alias (__re_compile_fastmap, re_compile_fastmap)
-#endif
 
 static inline void
 __attribute__ ((always_inline))
@@ -464,7 +458,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t 
*init_state,
    the return codes and their meanings.)  */
 
 int
-regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags)
+regcomp (regex_t *__restrict preg, const char *__restrict pattern, int cflags)
 {
   reg_errcode_t ret;
   reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED
@@ -515,16 +509,14 @@ regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ 
pattern, int cflags)
 
   return (int) ret;
 }
-#ifdef _LIBC
 libc_hidden_def (__regcomp)
 weak_alias (__regcomp, regcomp)
-#endif
 
 /* Returns a message corresponding to an error code, ERRCODE, returned
    from either regcomp or regexec.   We don't use PREG here.  */
 
 size_t
-regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf,
+regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf,
          size_t errbuf_size)
 {
   const char *msg;
@@ -555,9 +547,7 @@ regerror (int errcode, const regex_t *_Restrict_ preg, char 
*_Restrict_ errbuf,
 
   return msg_size;
 }
-#ifdef _LIBC
 weak_alias (__regerror, regerror)
-#endif
 
 
 #ifdef RE_ENABLE_I18N
@@ -657,10 +647,8 @@ regfree (regex_t *preg)
   re_free (preg->translate);
   preg->translate = NULL;
 }
-#ifdef _LIBC
 libc_hidden_def (__regfree)
 weak_alias (__regfree, regfree)
-#endif
 
 /* Entry points compatible with 4.2 BSD regex library.  We don't define
    them unless specifically requested.  */
diff --git a/lib/regex.c b/lib/regex.c
index 2a86e10..1fccd99 100644
--- a/lib/regex.c
+++ b/lib/regex.c
@@ -20,10 +20,10 @@
 #ifndef _LIBC
 # include <libc-config.h>
 
-# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+# if __GNUC_PREREQ (4, 6)
 #  pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
 # endif
-# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+# if __GNUC_PREREQ (4, 3)
 #  pragma GCC diagnostic ignored "-Wold-style-definition"
 #  pragma GCC diagnostic ignored "-Wtype-limits"
 # endif
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index b0e49cd..2c5ca29 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -144,10 +144,9 @@
 # define __mbrtowc mbrtowc
 # define __wcrtomb wcrtomb
 # define __regfree regfree
-# define attribute_hidden
 #endif /* not _LIBC */
 
-#if __GNUC__ < 3 + (__GNUC_MINOR__ < 1)
+#if !__GNUC_PREREQ (3, 1)
 # define __attribute__(arg)
 #endif
 
@@ -868,15 +867,6 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx)
 }
 #endif /* RE_ENABLE_I18N */
 
-#ifndef __GNUC_PREREQ
-# if defined __GNUC__ && defined __GNUC_MINOR__
-#  define __GNUC_PREREQ(maj, min) \
-         ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-# else
-#  define __GNUC_PREREQ(maj, min) 0
-# endif
-#endif
-
 #if __GNUC_PREREQ (3,4)
 # undef __attribute_warn_unused_result__
 # define __attribute_warn_unused_result__ \
diff --git a/lib/regexec.c b/lib/regexec.c
index c7d099c..5f68269 100644
--- a/lib/regexec.c
+++ b/lib/regexec.c
@@ -189,7 +189,7 @@ static reg_errcode_t extend_buffers (re_match_context_t 
*mctx, int min_len);
    We return 0 if we find a match and REG_NOMATCH if not.  */
 
 int
-regexec (const regex_t *_Restrict_ preg, const char *_Restrict_ string,
+regexec (const regex_t *__restrict preg, const char *__restrict string,
         size_t nmatch, regmatch_t pmatch[], int eflags)
 {
   reg_errcode_t err;
@@ -232,8 +232,8 @@ __typeof__ (__regexec) __compat_regexec;
 
 int
 attribute_compat_text_section
-__compat_regexec (const regex_t *_Restrict_ preg,
-                 const char *_Restrict_ string, size_t nmatch,
+__compat_regexec (const regex_t *__restrict preg,
+                 const char *__restrict string, size_t nmatch,
                  regmatch_t pmatch[], int eflags)
 {
   return regexec (preg, string, nmatch, pmatch,



reply via email to

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