[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Thu, 11 Mar 2021 15:47:07 -0500 (EST) |
branch: master
commit e3529d91abed939dde0975c0d71735b0fd0395fb
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Thu Mar 11 20:46:31 2021 +0000
gnulib update
---
gnulib/lib/cdefs.h | 12 +-
gnulib/lib/dynarray.h | 255 ++++++++++++++++++++++++++-
gnulib/lib/lc-charset-dispatch.c | 6 +-
gnulib/lib/libc-config.h | 6 +-
gnulib/lib/malloc/dynarray-skeleton.c | 33 ++--
gnulib/lib/malloc/dynarray_at_failure.c | 4 +
gnulib/lib/malloc/dynarray_emplace_enlarge.c | 4 +
gnulib/lib/malloc/dynarray_finalize.c | 4 +
gnulib/lib/malloc/dynarray_resize.c | 4 +
gnulib/lib/malloc/dynarray_resize_clear.c | 4 +
gnulib/lib/mbtowc-lock.h | 12 +-
gnulib/lib/regex_internal.h | 4 +-
gnulib/lib/stddef.in.h | 9 +-
gnulib/lib/wcwidth.c | 2 +-
gnulib/m4/gnulib-comp.m4 | 1 +
gnulib/m4/host-cpu-c-abi.m4 | 6 +-
gnulib/m4/lib-ld.m4 | 4 +-
gnulib/m4/visibility.m4 | 3 +-
tp/Texinfo/XS/gnulib/lib/stddef.in.h | 9 +-
tp/Texinfo/XS/gnulib/m4/host-cpu-c-abi.m4 | 6 +-
tp/Texinfo/XS/gnulib/m4/lib-ld.m4 | 4 +-
21 files changed, 345 insertions(+), 47 deletions(-)
diff --git a/gnulib/lib/cdefs.h b/gnulib/lib/cdefs.h
index 17a0919..24d2875 100644
--- a/gnulib/lib/cdefs.h
+++ b/gnulib/lib/cdefs.h
@@ -321,15 +321,15 @@
/* The nonnull function attribute marks pointer parameters that
must not be NULL. */
-#ifndef __nonnull
+#ifndef __attribute_nonnull__
# if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__)
-# define __nonnull(params) __attribute__ ((__nonnull__ params))
+# define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params))
# else
-# define __nonnull(params)
+# define __attribute_nonnull__(params)
# endif
-#elif !defined __GLIBC__
-# undef __nonnull
-# define __nonnull(params) _GL_ATTRIBUTE_NONNULL (params)
+#endif
+#ifndef __nonnull
+# define __nonnull(params) __attribute_nonnull__ (params)
#endif
/* If fortification mode, we warn about unused results of certain
diff --git a/gnulib/lib/dynarray.h b/gnulib/lib/dynarray.h
index 6da3e87..9a8d395 100644
--- a/gnulib/lib/dynarray.h
+++ b/gnulib/lib/dynarray.h
@@ -14,18 +14,267 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
-/* Written by Paul Eggert, 2021. */
+/* Written by Paul Eggert and Bruno Haible, 2021. */
#ifndef _GL_DYNARRAY_H
#define _GL_DYNARRAY_H
-#include <libc-config.h>
+/* Before including this file, you need to define:
+ DYNARRAY_STRUCT
+ The struct tag of dynamic array to be defined.
+
+ DYNARRAY_ELEMENT
+ The type name of the element type. Elements are copied
+ as if by memcpy, and can change address as the dynamic
+ array grows.
+
+ DYNARRAY_PREFIX
+ The prefix of the functions which are defined.
+
+ The following parameters are optional:
+
+ DYNARRAY_ELEMENT_FREE
+ DYNARRAY_ELEMENT_FREE (E) is evaluated to deallocate the
+ contents of elements. E is of type DYNARRAY_ELEMENT *.
+
+ DYNARRAY_ELEMENT_INIT
+ DYNARRAY_ELEMENT_INIT (E) is evaluated to initialize a new
+ element. E is of type DYNARRAY_ELEMENT *.
+ If DYNARRAY_ELEMENT_FREE but not DYNARRAY_ELEMENT_INIT is
+ defined, new elements are automatically zero-initialized.
+ Otherwise, new elements have undefined contents.
+
+ DYNARRAY_INITIAL_SIZE
+ The size of the statically allocated array (default:
+ at least 2, more elements if they fit into 128 bytes).
+ Must be a preprocessor constant. If DYNARRAY_INITIAL_SIZE is 0,
+ there is no statically allocated array at, and all non-empty
+ arrays are heap-allocated.
+
+ DYNARRAY_FINAL_TYPE
+ The name of the type which holds the final array. If not
+ defined, is PREFIX##finalize not provided. DYNARRAY_FINAL_TYPE
+ must be a struct type, with members of type DYNARRAY_ELEMENT and
+ size_t at the start (in this order).
+
+ These macros are undefined after this header file has been
+ included.
+
+ The following types are provided (their members are private to the
+ dynarray implementation):
+
+ struct DYNARRAY_STRUCT
+
+ The following functions are provided:
+ */
+
+/* Initialize a dynamic array object. This must be called before any
+ use of the object. */
+#if 0
+static void
+ DYNARRAY_PREFIX##init (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Deallocate the dynamic array and its elements. */
+#if 0
+static void
+ DYNARRAY_PREFIX##free (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return true if the dynamic array is in an error state. */
+#if 0
+static bool
+ DYNARRAY_PREFIX##has_failed (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Mark the dynamic array as failed. All elements are deallocated as
+ a side effect. */
+#if 0
+static void
+ DYNARRAY_PREFIX##mark_failed (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return the number of elements which have been added to the dynamic
+ array. */
+#if 0
+static size_t
+ DYNARRAY_PREFIX##size (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return a pointer to the first array element, if any. For a
+ zero-length array, the pointer can be NULL even though the dynamic
+ array has not entered the failure state. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##begin (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return a pointer one element past the last array element. For a
+ zero-length array, the pointer can be NULL even though the dynamic
+ array has not entered the failure state. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##end (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return a pointer to the array element at INDEX. Terminate the
+ process if INDEX is out of bounds. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##at (struct DYNARRAY_STRUCT *list, size_t index);
+#endif
+
+/* Add ITEM at the end of the array, enlarging it by one element.
+ Mark *LIST as failed if the dynamic array allocation size cannot be
+ increased. */
+#if 0
+static void
+ DYNARRAY_PREFIX##add (struct DYNARRAY_STRUCT *list,
+ DYNARRAY_ELEMENT item);
+#endif
+
+/* Allocate a place for a new element in *LIST and return a pointer to
+ it. The pointer can be NULL if the dynamic array cannot be
+ enlarged due to a memory allocation failure. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##emplace (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Change the size of *LIST to SIZE. If SIZE is larger than the
+ existing size, new elements are added (which can be initialized).
+ Otherwise, the list is truncated, and elements are freed. Return
+ false on memory allocation failure (and mark *LIST as failed). */
+#if 0
+static bool
+ DYNARRAY_PREFIX##resize (struct DYNARRAY_STRUCT *list, size_t size);
+#endif
+
+/* Remove the last element of LIST if it is present. */
+#if 0
+static void
+ DYNARRAY_PREFIX##remove_last (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Remove all elements from the list. The elements are freed, but the
+ list itself is not. */
+#if 0
+static void
+ DYNARRAY_PREFIX##clear (struct DYNARRAY_STRUCT *list);
+#endif
+
+#if defined DYNARRAY_FINAL_TYPE
+/* Transfer the dynamic array to a permanent location at *RESULT.
+ Returns true on success on false on allocation failure. In either
+ case, *LIST is re-initialized and can be reused. A NULL pointer is
+ stored in *RESULT if LIST refers to an empty list. On success, the
+ pointer in *RESULT is heap-allocated and must be deallocated using
+ free. */
+#if 0
+static bool
+ DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *list,
+ DYNARRAY_FINAL_TYPE *result);
+#endif
+#else /* !defined DYNARRAY_FINAL_TYPE */
+/* Transfer the dynamic array to a heap-allocated array and return a
+ pointer to it. The pointer is NULL if memory allocation fails, or
+ if the array is empty, so this function should be used only for
+ arrays which are known not be empty (usually because they always
+ have a sentinel at the end). If LENGTHP is not NULL, the array
+ length is written to *LENGTHP. *LIST is re-initialized and can be
+ reused. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *list,
+ size_t *lengthp);
+#endif
+#endif
+
+/* A minimal example which provides a growing list of integers can be
+ defined like this:
+
+ struct int_array
+ {
+ // Pointer to result array followed by its length,
+ // as required by DYNARRAY_FINAL_TYPE.
+ int *array;
+ size_t length;
+ };
+
+ #define DYNARRAY_STRUCT dynarray_int
+ #define DYNARRAY_ELEMENT int
+ #define DYNARRAY_PREFIX dynarray_int_
+ #define DYNARRAY_FINAL_TYPE struct int_array
+ #include <malloc/dynarray-skeleton.c>
+
+ To create a three-element array with elements 1, 2, 3, use this
+ code:
+
+ struct dynarray_int dyn;
+ dynarray_int_init (&dyn);
+ for (int i = 1; i <= 3; ++i)
+ {
+ int *place = dynarray_int_emplace (&dyn);
+ assert (place != NULL);
+ *place = i;
+ }
+ struct int_array result;
+ bool ok = dynarray_int_finalize (&dyn, &result);
+ assert (ok);
+ assert (result.length == 3);
+ assert (result.array[0] == 1);
+ assert (result.array[1] == 2);
+ assert (result.array[2] == 3);
+ free (result.array);
+
+ If the elements contain resources which must be freed, define
+ DYNARRAY_ELEMENT_FREE appropriately, like this:
+
+ struct str_array
+ {
+ char **array;
+ size_t length;
+ };
+
+ #define DYNARRAY_STRUCT dynarray_str
+ #define DYNARRAY_ELEMENT char *
+ #define DYNARRAY_ELEMENT_FREE(ptr) free (*ptr)
+ #define DYNARRAY_PREFIX dynarray_str_
+ #define DYNARRAY_FINAL_TYPE struct str_array
+ #include <malloc/dynarray-skeleton.c>
+ */
+
+
+/* The implementation is imported from glibc. */
+
+/* Avoid possible conflicts with symbols exported by the GNU libc. */
#define __libc_dynarray_at_failure gl_dynarray_at_failure
#define __libc_dynarray_emplace_enlarge gl_dynarray_emplace_enlarge
#define __libc_dynarray_finalize gl_dynarray_finalize
#define __libc_dynarray_resize_clear gl_dynarray_resize_clear
#define __libc_dynarray_resize gl_dynarray_resize
-#include <malloc/dynarray.h>
+
+#if defined DYNARRAY_STRUCT || defined DYNARRAY_ELEMENT || defined
DYNARRAY_PREFIX
+
+# include <libc-config.h>
+
+/* Define auxiliary structs and declare auxiliary functions, common to all
+ instantiations of dynarray. */
+# include <malloc/dynarray.h>
+
+/* Define the instantiation, specified through
+ DYNARRAY_STRUCT
+ DYNARRAY_ELEMENT
+ DYNARRAY_PREFIX
+ etc. */
+# include <malloc/dynarray-skeleton.c>
+
+#else
+
+/* This file is being included from one of the malloc/dynarray_*.c files. */
+# include <malloc/dynarray.h>
+
+#endif
#endif /* _GL_DYNARRAY_H */
diff --git a/gnulib/lib/lc-charset-dispatch.c b/gnulib/lib/lc-charset-dispatch.c
index 879f71a..5c63c4b 100644
--- a/gnulib/lib/lc-charset-dispatch.c
+++ b/gnulib/lib/lc-charset-dispatch.c
@@ -26,7 +26,7 @@
# include "localcharset.h"
# include "streq.h"
-# if GNULIB_WCHAR_SINGLE
+# if GNULIB_WCHAR_SINGLE_LOCALE
/* When we know that the locale does not change, provide a speedup by
caching the value of locale_encoding_classification. */
# define locale_encoding_classification_cached locale_encoding_classification
@@ -35,7 +35,7 @@
# define locale_encoding_classification_uncached
locale_encoding_classification
# endif
-# if GNULIB_WCHAR_SINGLE
+# if GNULIB_WCHAR_SINGLE_LOCALE
static inline
# endif
enc_t
@@ -59,7 +59,7 @@ locale_encoding_classification_uncached (void)
return enc_other;
}
-# if GNULIB_WCHAR_SINGLE
+# if GNULIB_WCHAR_SINGLE_LOCALE
static int cached_locale_enc = -1;
diff --git a/gnulib/lib/libc-config.h b/gnulib/lib/libc-config.h
index c0eac70..e734824 100644
--- a/gnulib/lib/libc-config.h
+++ b/gnulib/lib/libc-config.h
@@ -33,9 +33,9 @@
#include <config.h>
/* On glibc this includes <features.h> and <sys/cdefs.h> and #defines
- _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 it
- includes <sys/cdefs.h> which defines __nonnull. Elsewhere it
- is harmless. */
+ _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 and
+ DragonFlyBSD 5.9 it includes <sys/cdefs.h> which defines __nonnull.
+ Elsewhere it is harmless. */
#include <errno.h>
/* From glibc <errno.h>. */
diff --git a/gnulib/lib/malloc/dynarray-skeleton.c
b/gnulib/lib/malloc/dynarray-skeleton.c
index 4995fd1..de65653 100644
--- a/gnulib/lib/malloc/dynarray-skeleton.c
+++ b/gnulib/lib/malloc/dynarray-skeleton.c
@@ -192,7 +192,7 @@ DYNARRAY_NAME (free__array__) (struct DYNARRAY_STRUCT *list)
/* Initialize a dynamic array object. This must be called before any
use of the object. */
-__nonnull ((1))
+__attribute_nonnull__ ((1))
static void
DYNARRAY_NAME (init) (struct DYNARRAY_STRUCT *list)
{
@@ -202,7 +202,7 @@ DYNARRAY_NAME (init) (struct DYNARRAY_STRUCT *list)
}
/* Deallocate the dynamic array and its elements. */
-__attribute_maybe_unused__ __nonnull ((1))
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
static void
DYNARRAY_FREE (struct DYNARRAY_STRUCT *list)
{
@@ -213,7 +213,7 @@ DYNARRAY_FREE (struct DYNARRAY_STRUCT *list)
}
/* Return true if the dynamic array is in an error state. */
-__nonnull ((1))
+__attribute_nonnull__ ((1))
static inline bool
DYNARRAY_NAME (has_failed) (const struct DYNARRAY_STRUCT *list)
{
@@ -222,7 +222,7 @@ DYNARRAY_NAME (has_failed) (const struct DYNARRAY_STRUCT
*list)
/* Mark the dynamic array as failed. All elements are deallocated as
a side effect. */
-__nonnull ((1))
+__attribute_nonnull__ ((1))
static void
DYNARRAY_NAME (mark_failed) (struct DYNARRAY_STRUCT *list)
{
@@ -236,7 +236,7 @@ DYNARRAY_NAME (mark_failed) (struct DYNARRAY_STRUCT *list)
/* Return the number of elements which have been added to the dynamic
array. */
-__nonnull ((1))
+__attribute_nonnull__ ((1))
static inline size_t
DYNARRAY_NAME (size) (const struct DYNARRAY_STRUCT *list)
{
@@ -245,7 +245,7 @@ DYNARRAY_NAME (size) (const struct DYNARRAY_STRUCT *list)
/* Return a pointer to the array element at INDEX. Terminate the
process if INDEX is out of bounds. */
-__nonnull ((1))
+__attribute_nonnull__ ((1))
static inline DYNARRAY_ELEMENT *
DYNARRAY_NAME (at) (struct DYNARRAY_STRUCT *list, size_t index)
{
@@ -257,7 +257,7 @@ DYNARRAY_NAME (at) (struct DYNARRAY_STRUCT *list, size_t
index)
/* Return a pointer to the first array element, if any. For a
zero-length array, the pointer can be NULL even though the dynamic
array has not entered the failure state. */
-__nonnull ((1))
+__attribute_nonnull__ ((1))
static inline DYNARRAY_ELEMENT *
DYNARRAY_NAME (begin) (struct DYNARRAY_STRUCT *list)
{
@@ -267,7 +267,7 @@ DYNARRAY_NAME (begin) (struct DYNARRAY_STRUCT *list)
/* Return a pointer one element past the last array element. For a
zero-length array, the pointer can be NULL even though the dynamic
array has not entered the failure state. */
-__nonnull ((1))
+__attribute_nonnull__ ((1))
static inline DYNARRAY_ELEMENT *
DYNARRAY_NAME (end) (struct DYNARRAY_STRUCT *list)
{
@@ -294,7 +294,7 @@ DYNARRAY_NAME (add__) (struct DYNARRAY_STRUCT *list,
DYNARRAY_ELEMENT item)
/* Add ITEM at the end of the array, enlarging it by one element.
Mark *LIST as failed if the dynamic array allocation size cannot be
increased. */
-__nonnull ((1))
+__attribute_nonnull__ ((1))
static inline void
DYNARRAY_NAME (add) (struct DYNARRAY_STRUCT *list, DYNARRAY_ELEMENT item)
{
@@ -348,7 +348,8 @@ DYNARRAY_NAME (emplace__) (struct DYNARRAY_STRUCT *list)
/* Allocate a place for a new element in *LIST and return a pointer to
it. The pointer can be NULL if the dynamic array cannot be
enlarged due to a memory allocation failure. */
-__attribute_maybe_unused__ __attribute_warn_unused_result__ __nonnull ((1))
+__attribute_maybe_unused__ __attribute_warn_unused_result__
+__attribute_nonnull__ ((1))
static
/* Avoid inlining with the larger initialization code. */
#if !(defined (DYNARRAY_ELEMENT_INIT) || defined (DYNARRAY_ELEMENT_FREE))
@@ -372,7 +373,7 @@ DYNARRAY_NAME (emplace) (struct DYNARRAY_STRUCT *list)
existing size, new elements are added (which can be initialized).
Otherwise, the list is truncated, and elements are freed. Return
false on memory allocation failure (and mark *LIST as failed). */
-__attribute_maybe_unused__ __nonnull ((1))
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
static bool
DYNARRAY_NAME (resize) (struct DYNARRAY_STRUCT *list, size_t size)
{
@@ -417,7 +418,7 @@ DYNARRAY_NAME (resize) (struct DYNARRAY_STRUCT *list,
size_t size)
}
/* Remove the last element of LIST if it is present. */
-__attribute_maybe_unused__ __nonnull ((1))
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
static void
DYNARRAY_NAME (remove_last) (struct DYNARRAY_STRUCT *list)
{
@@ -434,7 +435,7 @@ DYNARRAY_NAME (remove_last) (struct DYNARRAY_STRUCT *list)
/* Remove all elements from the list. The elements are freed, but the
list itself is not. */
-__attribute_maybe_unused__ __nonnull ((1))
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
static void
DYNARRAY_NAME (clear) (struct DYNARRAY_STRUCT *list)
{
@@ -452,7 +453,8 @@ DYNARRAY_NAME (clear) (struct DYNARRAY_STRUCT *list)
stored in *RESULT if LIST refers to an empty list. On success, the
pointer in *RESULT is heap-allocated and must be deallocated using
free. */
-__attribute_maybe_unused__ __attribute_warn_unused_result__ __nonnull ((1, 2))
+__attribute_maybe_unused__ __attribute_warn_unused_result__
+__attribute_nonnull__ ((1, 2))
static bool
DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list,
DYNARRAY_FINAL_TYPE *result)
@@ -483,7 +485,8 @@ DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list,
have a sentinel at the end). If LENGTHP is not NULL, the array
length is written to *LENGTHP. *LIST is re-initialized and can be
reused. */
-__attribute_maybe_unused__ __attribute_warn_unused_result__ __nonnull ((1))
+__attribute_maybe_unused__ __attribute_warn_unused_result__
+__attribute_nonnull__ ((1))
static DYNARRAY_ELEMENT *
DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list, size_t *lengthp)
{
diff --git a/gnulib/lib/malloc/dynarray_at_failure.c
b/gnulib/lib/malloc/dynarray_at_failure.c
index a442459..d96d597 100644
--- a/gnulib/lib/malloc/dynarray_at_failure.c
+++ b/gnulib/lib/malloc/dynarray_at_failure.c
@@ -16,6 +16,10 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
#include <dynarray.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/gnulib/lib/malloc/dynarray_emplace_enlarge.c
b/gnulib/lib/malloc/dynarray_emplace_enlarge.c
index 7ac4b6d..ac5814b 100644
--- a/gnulib/lib/malloc/dynarray_emplace_enlarge.c
+++ b/gnulib/lib/malloc/dynarray_emplace_enlarge.c
@@ -16,6 +16,10 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
#include <dynarray.h>
#include <errno.h>
#include <intprops.h>
diff --git a/gnulib/lib/malloc/dynarray_finalize.c
b/gnulib/lib/malloc/dynarray_finalize.c
index be9441e..8c3335c 100644
--- a/gnulib/lib/malloc/dynarray_finalize.c
+++ b/gnulib/lib/malloc/dynarray_finalize.c
@@ -16,6 +16,10 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
#include <dynarray.h>
#include <stdlib.h>
#include <string.h>
diff --git a/gnulib/lib/malloc/dynarray_resize.c
b/gnulib/lib/malloc/dynarray_resize.c
index 92bbddd..bc34b42 100644
--- a/gnulib/lib/malloc/dynarray_resize.c
+++ b/gnulib/lib/malloc/dynarray_resize.c
@@ -16,6 +16,10 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
#include <dynarray.h>
#include <errno.h>
#include <intprops.h>
diff --git a/gnulib/lib/malloc/dynarray_resize_clear.c
b/gnulib/lib/malloc/dynarray_resize_clear.c
index 99c2cc8..4e67bce 100644
--- a/gnulib/lib/malloc/dynarray_resize_clear.c
+++ b/gnulib/lib/malloc/dynarray_resize_clear.c
@@ -16,6 +16,10 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
#include <dynarray.h>
#include <string.h>
diff --git a/gnulib/lib/mbtowc-lock.h b/gnulib/lib/mbtowc-lock.h
index 696b12c..3b6f5f9 100644
--- a/gnulib/lib/mbtowc-lock.h
+++ b/gnulib/lib/mbtowc-lock.h
@@ -32,7 +32,17 @@ mbtowc_unlocked (wchar_t *pwc, const char *p, size_t m)
/* Prohibit renaming this symbol. */
#undef gl_get_mbtowc_lock
-#if defined _WIN32 && !defined __CYGWIN__
+#if GNULIB_MBRTOWC_SINGLE_THREAD
+
+/* All uses of this function are in a single thread. No locking needed. */
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+ return mbtowc_unlocked (pwc, p, m);
+}
+
+#elif defined _WIN32 && !defined __CYGWIN__
extern __declspec(dllimport) CRITICAL_SECTION *gl_get_mbtowc_lock (void);
diff --git a/gnulib/lib/regex_internal.h b/gnulib/lib/regex_internal.h
index 541d3c3..affc4fe 100644
--- a/gnulib/lib/regex_internal.h
+++ b/gnulib/lib/regex_internal.h
@@ -53,14 +53,14 @@
# define lock_fini(lock) ((void) 0)
# define lock_lock(lock) __libc_lock_lock (lock)
# define lock_unlock(lock) __libc_lock_unlock (lock)
-#elif defined GNULIB_LOCK && !defined USE_UNLOCKED_IO
+#elif defined GNULIB_LOCK && !defined GNULIB_REGEX_SINGLE_THREAD
# include "glthread/lock.h"
# define lock_define(name) gl_lock_define (, name)
# define lock_init(lock) glthread_lock_init (&(lock))
# define lock_fini(lock) glthread_lock_destroy (&(lock))
# define lock_lock(lock) glthread_lock_lock (&(lock))
# define lock_unlock(lock) glthread_lock_unlock (&(lock))
-#elif defined GNULIB_PTHREAD && !defined USE_UNLOCKED_IO
+#elif defined GNULIB_PTHREAD && !defined GNULIB_REGEX_SINGLE_THREAD
# include <pthread.h>
# define lock_define(name) pthread_mutex_t name;
# define lock_init(lock) pthread_mutex_init (&(lock), 0)
diff --git a/gnulib/lib/stddef.in.h b/gnulib/lib/stddef.in.h
index 330e2e5..d878b9d 100644
--- a/gnulib/lib/stddef.in.h
+++ b/gnulib/lib/stddef.in.h
@@ -42,6 +42,13 @@
# define _GL_STDDEF_WINT_T
# endif
# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+ /* On TinyCC, make sure that the macros that indicate the special invocation
+ convention get undefined. */
+# undef __need_wchar_t
+# undef __need_size_t
+# undef __need_ptrdiff_t
+# undef __need_NULL
+# undef __need_wint_t
# endif
#else
@@ -51,7 +58,7 @@
/* On AIX 7.2, with xlc in 64-bit mode, <stddef.h> defines max_align_t to a
type with alignment 4, but 'long' has alignment 8. */
-# if defined _AIX && defined _ARCH_PPC64
+# if defined _AIX && defined __LP64__
# if !GNULIB_defined_max_align_t
# ifdef _MAX_ALIGN_T
/* /usr/include/stddef.h has already defined max_align_t. Override it. */
diff --git a/gnulib/lib/wcwidth.c b/gnulib/lib/wcwidth.c
index 9009ebc..8d85082 100644
--- a/gnulib/lib/wcwidth.c
+++ b/gnulib/lib/wcwidth.c
@@ -34,7 +34,7 @@ is_locale_utf8 (void)
return STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0);
}
-#if GNULIB_WCHAR_SINGLE
+#if GNULIB_WCHAR_SINGLE_LOCALE
/* When we know that the locale does not change, provide a speedup by
caching the value of is_locale_utf8. */
static int cached_is_locale_utf8 = -1;
diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4
index 905958f..fd08b0b 100644
--- a/gnulib/m4/gnulib-comp.m4
+++ b/gnulib/m4/gnulib-comp.m4
@@ -507,6 +507,7 @@ AC_DEFUN([gl_INIT],
{
if ! $gl_gnulib_enabled_dynarray; then
gl_gnulib_enabled_dynarray=true
+ func_gl_gnulib_m4code_intprops
func_gl_gnulib_m4code_21ee726a3540c09237a8e70c0baf7467
fi
}
diff --git a/gnulib/m4/host-cpu-c-abi.m4 b/gnulib/m4/host-cpu-c-abi.m4
index 7dc830e..64e28b1 100644
--- a/gnulib/m4/host-cpu-c-abi.m4
+++ b/gnulib/m4/host-cpu-c-abi.m4
@@ -1,4 +1,4 @@
-# host-cpu-c-abi.m4 serial 13
+# host-cpu-c-abi.m4 serial 14
dnl Copyright (C) 2002-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -211,7 +211,7 @@ changequote([,])dnl
# be generating 64-bit code.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
- [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ [[#if defined __powerpc64__ || defined __LP64__
int ok;
#else
error fail
@@ -605,7 +605,7 @@ changequote([,])dnl
# be generating 64-bit code.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
- [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ [[#if defined __powerpc64__ || defined __LP64__
int ok;
#else
error fail
diff --git a/gnulib/m4/lib-ld.m4 b/gnulib/m4/lib-ld.m4
index aa07cb4..076358d 100644
--- a/gnulib/m4/lib-ld.m4
+++ b/gnulib/m4/lib-ld.m4
@@ -1,4 +1,4 @@
-# lib-ld.m4 serial 9
+# lib-ld.m4 serial 10
dnl Copyright (C) 1996-2003, 2009-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -122,7 +122,7 @@ else
*-*-aix*)
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
- [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ [[#if defined __powerpc64__ || defined __LP64__
int ok;
#else
error fail
diff --git a/gnulib/m4/visibility.m4 b/gnulib/m4/visibility.m4
index 6e4b461..8f27a12 100644
--- a/gnulib/m4/visibility.m4
+++ b/gnulib/m4/visibility.m4
@@ -1,4 +1,4 @@
-# visibility.m4 serial 6
+# visibility.m4 serial 7
dnl Copyright (C) 2005, 2008, 2010-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -58,6 +58,7 @@ AC_DEFUN([gl_VISIBILITY],
extern __attribute__((__visibility__("default"))) int
exportedvar;
extern __attribute__((__visibility__("hidden"))) int hiddenfunc
(void);
extern __attribute__((__visibility__("default"))) int
exportedfunc (void);
+ void dummyfunc (void);
void dummyfunc (void) {}
]],
[[]])],
diff --git a/tp/Texinfo/XS/gnulib/lib/stddef.in.h
b/tp/Texinfo/XS/gnulib/lib/stddef.in.h
index 330e2e5..d878b9d 100644
--- a/tp/Texinfo/XS/gnulib/lib/stddef.in.h
+++ b/tp/Texinfo/XS/gnulib/lib/stddef.in.h
@@ -42,6 +42,13 @@
# define _GL_STDDEF_WINT_T
# endif
# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+ /* On TinyCC, make sure that the macros that indicate the special invocation
+ convention get undefined. */
+# undef __need_wchar_t
+# undef __need_size_t
+# undef __need_ptrdiff_t
+# undef __need_NULL
+# undef __need_wint_t
# endif
#else
@@ -51,7 +58,7 @@
/* On AIX 7.2, with xlc in 64-bit mode, <stddef.h> defines max_align_t to a
type with alignment 4, but 'long' has alignment 8. */
-# if defined _AIX && defined _ARCH_PPC64
+# if defined _AIX && defined __LP64__
# if !GNULIB_defined_max_align_t
# ifdef _MAX_ALIGN_T
/* /usr/include/stddef.h has already defined max_align_t. Override it. */
diff --git a/tp/Texinfo/XS/gnulib/m4/host-cpu-c-abi.m4
b/tp/Texinfo/XS/gnulib/m4/host-cpu-c-abi.m4
index 7dc830e..64e28b1 100644
--- a/tp/Texinfo/XS/gnulib/m4/host-cpu-c-abi.m4
+++ b/tp/Texinfo/XS/gnulib/m4/host-cpu-c-abi.m4
@@ -1,4 +1,4 @@
-# host-cpu-c-abi.m4 serial 13
+# host-cpu-c-abi.m4 serial 14
dnl Copyright (C) 2002-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -211,7 +211,7 @@ changequote([,])dnl
# be generating 64-bit code.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
- [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ [[#if defined __powerpc64__ || defined __LP64__
int ok;
#else
error fail
@@ -605,7 +605,7 @@ changequote([,])dnl
# be generating 64-bit code.
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
- [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ [[#if defined __powerpc64__ || defined __LP64__
int ok;
#else
error fail
diff --git a/tp/Texinfo/XS/gnulib/m4/lib-ld.m4
b/tp/Texinfo/XS/gnulib/m4/lib-ld.m4
index aa07cb4..076358d 100644
--- a/tp/Texinfo/XS/gnulib/m4/lib-ld.m4
+++ b/tp/Texinfo/XS/gnulib/m4/lib-ld.m4
@@ -1,4 +1,4 @@
-# lib-ld.m4 serial 9
+# lib-ld.m4 serial 10
dnl Copyright (C) 1996-2003, 2009-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -122,7 +122,7 @@ else
*-*-aix*)
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE(
- [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ [[#if defined __powerpc64__ || defined __LP64__
int ok;
#else
error fail