mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2025-08-07 00:06:58 +02:00
Bump to the next stable branch with the May 2025 update. Add a patch to compensate for gnulib-tool being further split up into independent shell and python implementations by using a non-hidden version of the main.py file. Add a patch for the python implementation of gnulib-tool in order to ignore the required version of autoconf in configure.ac being lower than the required version of autoconf for gnulib if the version that is being run exceeds the required version for both, and adjust existing autoconf version shell script patch to new filename. Backport a patch for a change in function naming convention for forward compatibility with tool releases after this stable branch. Added: - 020-python-version.patch - 021-python-main.patch - 500-acl-function-name.patch Manually Adjusted: - 010-autoconf-version.patch - 160-flag-reallocarray.patch Existing patches are automatically refreshed. Signed-off-by: Michael Pratt <mcpratt@pm.me> Link: https://github.com/openwrt/openwrt/pull/16522 Signed-off-by: Robert Marko <robimarko@gmail.com>
115 lines
2.8 KiB
Diff
115 lines
2.8 KiB
Diff
--- a/lib/ialloc.h
|
|
+++ b/lib/ialloc.h
|
|
@@ -106,6 +106,8 @@ icalloc (idx_t n, idx_t s)
|
|
return calloc (n, s);
|
|
}
|
|
|
|
+#if GNULIB_REALLOCARRAY
|
|
+
|
|
/* ireallocarray (ptr, num, size) is like reallocarray (ptr, num, size).
|
|
It returns a non-NULL pointer to num * size bytes of memory.
|
|
Upon failure, it returns NULL with errno set. */
|
|
@@ -131,6 +133,8 @@ ireallocarray (void *p, idx_t n, idx_t s
|
|
return _gl_alloc_nomem ();
|
|
}
|
|
|
|
+#endif /* GNULIB_REALLOCARRAY */
|
|
+
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
--- a/lib/xmalloc.c
|
|
+++ b/lib/xmalloc.c
|
|
@@ -51,12 +51,16 @@ ximalloc (idx_t s)
|
|
return check_nonnull (imalloc (s));
|
|
}
|
|
|
|
+#if GNULIB_REALLOCARRAY
|
|
+
|
|
char *
|
|
xcharalloc (size_t n)
|
|
{
|
|
return XNMALLOC (n, char);
|
|
}
|
|
|
|
+#endif /* GNULIB_REALLOCARRAY */
|
|
+
|
|
/* Change the size of an allocated block of memory P to S bytes,
|
|
with error checking. */
|
|
|
|
@@ -75,6 +79,8 @@ xirealloc (void *p, idx_t s)
|
|
return check_nonnull (irealloc (p, s));
|
|
}
|
|
|
|
+#if GNULIB_REALLOCARRAY
|
|
+
|
|
/* Change the size of an allocated block of memory P to an array of N
|
|
objects each of S bytes, with error checking. */
|
|
|
|
@@ -205,6 +211,8 @@ x2nrealloc (void *p, size_t *pn, size_t
|
|
return p;
|
|
}
|
|
|
|
+#endif /* GNULIB_REALLOCARRAY */
|
|
+
|
|
/* Grow PA, which points to an array of *PN items, and return the
|
|
location of the reallocated array, updating *PN to reflect its
|
|
new size. The new array will contain at least N_INCR_MIN more
|
|
--- a/lib/xalloc.h
|
|
+++ b/lib/xalloc.h
|
|
@@ -129,6 +129,7 @@ char *xstrdup (char const *str)
|
|
# define XCALLOC(n, t) \
|
|
((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t))))
|
|
|
|
+# if GNULIB_REALLOCARRAY
|
|
|
|
/* Allocate an array of N objects, each with S bytes of memory,
|
|
dynamically, with error checking. S must be nonzero. */
|
|
@@ -156,6 +157,8 @@ char *xcharalloc (size_t n)
|
|
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
|
|
_GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
|
|
|
|
+# endif /* GNULIB_REALLOCARRAY */
|
|
+
|
|
#endif /* GNULIB_XALLOC */
|
|
|
|
|
|
--- a/lib/safe-alloc.h
|
|
+++ b/lib/safe-alloc.h
|
|
@@ -40,6 +40,7 @@ _GL_INLINE_HEADER_BEGIN
|
|
extern "C" {
|
|
#endif
|
|
|
|
+#if GNULIB_REALLOCARRAY
|
|
|
|
/* Don't call these directly - use the macros below. */
|
|
SAFE_ALLOC_INLINE void *
|
|
@@ -56,6 +57,9 @@ safe_alloc_realloc_n (void *ptr, size_t
|
|
#endif
|
|
return ptr;
|
|
}
|
|
+
|
|
+#endif /* GNULIB_REALLOCARRAY */
|
|
+
|
|
_GL_ATTRIBUTE_NODISCARD SAFE_ALLOC_INLINE int
|
|
safe_alloc_check (void *ptr)
|
|
{
|
|
@@ -89,6 +93,8 @@ safe_alloc_check (void *ptr)
|
|
#define ALLOC_N(ptr, count) \
|
|
safe_alloc_check ((ptr) = calloc (count, sizeof *(ptr)))
|
|
|
|
+#if GNULIB_REALLOCARRAY
|
|
+
|
|
/**
|
|
* ALLOC_N_UNINITIALIZED:
|
|
* @ptr: pointer to allocated memory
|
|
@@ -117,6 +123,8 @@ safe_alloc_check (void *ptr)
|
|
#define REALLOC_N(ptr, count) \
|
|
safe_alloc_check ((ptr) = safe_alloc_realloc_n (ptr, count, sizeof *(ptr)))
|
|
|
|
+#endif /* GNULIB_REALLOCARRAY */
|
|
+
|
|
/**
|
|
* FREE:
|
|
* @ptr: pointer holding address to be freed
|