1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-01 20:06:00 +00:00

Update from gnulib

* admin/merge-gnulib (avoided_flags):
* cross/lib/cdefs.h (__bos):
(__glibc_unsigned_or_positive):
(__glibc_unsafe_len):
(__glibc_fortify):
(__glibc_fortify_n):
* cross/lib/isnan.c:
* cross/lib/libc-config.h:
* cross/lib/openat-proc.c (openat_proc_name):
* cross/lib/vasnprintf.c (VASNPRINTF):
* cross/lib/verify.h (_Static_assert):
(_GL_SA3):
* lib/gnulib.mk.in (HAVE_GRANTPT):
(HAVE_SPAWN_H):
(NEXT_AS_FIRST_DIRECTIVE_LIMITS_H):
(NEXT_LIMITS_H):
(REPLACE_GETSUBOPT):
(REPLACE_ILOGB):
(SYSTEM_TYPE):
(BUILT_SOURCES):
* lib/isnan.c:
* lib/vasnprintf.c (VASNPRINTF):
* lib/verify.h (_GL_SA3):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
* m4/gnulib-comp.m4 (gl_INIT): Update from gnulib.
This commit is contained in:
Po Lu 2023-02-05 21:06:11 +08:00
parent 0ee01457a8
commit 1b8beed960
13 changed files with 112 additions and 118 deletions

View File

@ -145,4 +145,5 @@ rm -rf "$src"cross/lib
cp -r "$src"lib "$src"cross
# Remove unnecessary files.
rm -f "$src"cross/lib/*.mk.in "$src"cross/lib/Makefile.in
rm -f "$src"cross/lib/*.mk.in "$src"cross/lib/Makefile.in \
"$src"cross/lib/Makefile

View File

@ -140,32 +140,37 @@
#endif
/* Gnulib avoids these definitions, as they don't work on non-glibc platforms.
In particular, __bos and __bos0 are defined differently in the Android libc.
*/
#ifndef __GNULIB_CDEFS
/* Fortify support. */
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
#define __bos0(ptr) __builtin_object_size (ptr, 0)
# define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
# define __bos0(ptr) __builtin_object_size (ptr, 0)
/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */
#if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \
|| __GNUC_PREREQ (12, 0))
# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
#else
# define __glibc_objsize0(__o) __bos0 (__o)
# define __glibc_objsize(__o) __bos (__o)
#endif
# if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \
|| __GNUC_PREREQ (12, 0))
# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
# else
# define __glibc_objsize0(__o) __bos0 (__o)
# define __glibc_objsize(__o) __bos (__o)
# endif
/* Compile time conditions to choose between the regular, _chk and _chk_warn
variants. These conditions should get evaluated to constant and optimized
away. */
#define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s))
#define __glibc_unsigned_or_positive(__l) \
# define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s))
# define __glibc_unsigned_or_positive(__l) \
((__typeof (__l)) 0 < (__typeof (__l)) -1 \
|| (__builtin_constant_p (__l) && (__l) > 0))
/* Length is known to be safe at compile time if the __L * __S <= __OBJSZ
condition can be folded to a constant and if it is true, or unknown (-1) */
#define __glibc_safe_or_unknown_len(__l, __s, __osz) \
# define __glibc_safe_or_unknown_len(__l, __s, __osz) \
((__osz) == (__SIZE_TYPE__) -1 \
|| (__glibc_unsigned_or_positive (__l) \
&& __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
@ -175,7 +180,7 @@
/* Conversely, we know at compile time that the length is unsafe if the
__L * __S <= __OBJSZ condition can be folded to a constant and if it is
false. */
#define __glibc_unsafe_len(__l, __s, __osz) \
# define __glibc_unsafe_len(__l, __s, __osz) \
(__glibc_unsigned_or_positive (__l) \
&& __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
__s, __osz)) \
@ -184,7 +189,7 @@
/* Fortify function f. __f_alias, __f_chk and __f_chk_warn must be
declared. */
#define __glibc_fortify(f, __l, __s, __osz, ...) \
# define __glibc_fortify(f, __l, __s, __osz, ...) \
(__glibc_safe_or_unknown_len (__l, __s, __osz) \
? __ ## f ## _alias (__VA_ARGS__) \
: (__glibc_unsafe_len (__l, __s, __osz) \
@ -194,13 +199,16 @@
/* Fortify function f, where object size argument passed to f is the number of
elements and not total size. */
#define __glibc_fortify_n(f, __l, __s, __osz, ...) \
# define __glibc_fortify_n(f, __l, __s, __osz, ...) \
(__glibc_safe_or_unknown_len (__l, __s, __osz) \
? __ ## f ## _alias (__VA_ARGS__) \
: (__glibc_unsafe_len (__l, __s, __osz) \
? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \
: __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) \
#endif
#if __GNUC_PREREQ (4,3)
# define __warnattr(msg) __attribute__((__warning__ (msg)))
# define __errordecl(name, msg) \

View File

@ -82,9 +82,10 @@ typedef union { DOUBLE value; unsigned int word[NWORDS]; } memory_double;
/* Most hosts nowadays use IEEE floating point, so they use IEC 60559
representations, have infinities and NaNs, and do not trap on
exceptions. Define IEEE_FLOATING_POINT if this host is one of the
typical ones. The C11 macro __STDC_IEC_559__ is close to what is
typical ones. The C23 macro __STDC_IEC_60559_BFP__ macro (or its cousin,
the now-obsolescent C11 macro __STDC_IEC_559__) is close to what is
wanted here, but is not quite right because this file does not require
all the features of C11 Annex F (and does not require C11 at all,
all the features of C23 Annex F (and works even with pre-C11 platforms,
for that matter). */
#define IEEE_FLOATING_POINT (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \

View File

@ -137,8 +137,6 @@
# undef __attribute_returns_twice__
# undef __attribute_used__
# undef __attribute_warn_unused_result__
# undef __bos
# undef __bos0
# undef __errordecl
# undef __extension__
# undef __extern_always_inline
@ -147,21 +145,13 @@
# undef __fortified_attr_access
# undef __fortify_function
# undef __glibc_c99_flexarr_available
# undef __glibc_fortify
# undef __glibc_fortify_n
# undef __glibc_has_attribute
# undef __glibc_has_builtin
# undef __glibc_has_extension
# undef __glibc_likely
# undef __glibc_macro_warning
# undef __glibc_macro_warning1
# undef __glibc_objsize
# undef __glibc_objsize0
# undef __glibc_safe_len_cond
# undef __glibc_safe_or_unknown_len
# undef __glibc_unlikely
# undef __glibc_unsafe_len
# undef __glibc_unsigned_or_positive
# undef __inline
# undef __ptr_t
# undef __restrict
@ -170,6 +160,18 @@
# undef __va_arg_pack_len
# undef __warnattr
# undef __wur
# ifndef __GNULIB_CDEFS
# undef __bos
# undef __bos0
# undef __glibc_fortify
# undef __glibc_fortify_n
# undef __glibc_objsize
# undef __glibc_objsize0
# undef __glibc_safe_len_cond
# undef __glibc_safe_or_unknown_len
# undef __glibc_unsafe_len
# undef __glibc_unsigned_or_positive
# endif
/* Include our copy of glibc <sys/cdefs.h>. */
# include <cdefs.h>

View File

@ -30,9 +30,12 @@
#include <string.h>
#include <unistd.h>
#ifdef __KLIBC__
#ifdef __KLIBC__ /* OS/2 */
# include <InnoTekLIBC/backend.h>
#endif
#ifdef __MVS__ /* z/OS */
# include <termios.h>
#endif
#include "intprops.h"
@ -53,7 +56,8 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
return buf;
}
#ifndef __KLIBC__
#if !(defined __KLIBC__ || defined __MVS__)
/* Generic code for Linux, Solaris, and similar platforms. */
# define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/"
{
enum {
@ -107,14 +111,29 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
dirlen = sprintf (result, PROC_SELF_FD_FORMAT, fd);
}
}
#else
#else /* (defined __KLIBC__ || defined __MVS__), i.e. OS/2 or z/OS */
/* OS/2 kLIBC provides a function to retrieve a path from a fd. */
{
char dir[_MAX_PATH];
size_t bufsize;
# ifdef __KLIBC__
char dir[_MAX_PATH];
if (__libc_Back_ioFHToPath (fd, dir, sizeof dir))
return NULL;
# endif
# ifdef __MVS__
char dir[_XOPEN_PATH_MAX];
/* Documentation:
https://www.ibm.com/docs/en/zos/2.2.0?topic=functions-w-ioctl-w-pioctl-control-devices */
if (w_ioctl (fd, _IOCC_GPN, sizeof dir, dir) < 0)
return NULL;
/* Documentation:
https://www.ibm.com/docs/en/zos/2.2.0?topic=functions-e2a-l-convert-characters-from-ebcdic-ascii */
dirlen = __e2a_l (dir, strlen (dir));
if (dirlen < 0 || dirlen >= sizeof dir)
return NULL;
dir[dirlen] = '\0';
# endif
dirlen = strlen (dir);
bufsize = dirlen + 1 + strlen (file) + 1; /* 1 for '/', 1 for null */

View File

@ -2130,7 +2130,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
}
if (characters < width && !(dp->flags & FLAG_LEFT))
if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2175,7 +2175,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
# endif
if (characters < width && (dp->flags & FLAG_LEFT))
if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2232,7 +2232,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
}
if (characters < width && !(dp->flags & FLAG_LEFT))
if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2277,7 +2277,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
# endif
if (characters < width && (dp->flags & FLAG_LEFT))
if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2334,7 +2334,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
}
if (characters < width && !(dp->flags & FLAG_LEFT))
if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2379,7 +2379,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
# endif
if (characters < width && (dp->flags & FLAG_LEFT))
if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2551,7 +2551,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
}
if (characters < width && !(dp->flags & FLAG_LEFT))
if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2612,7 +2612,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
if (characters < width && (dp->flags & FLAG_LEFT))
if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2768,7 +2768,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* w doesn't matter. */
w = 0;
if (w < width && !(dp->flags & FLAG_LEFT))
if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));
@ -2836,7 +2836,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
length += tmpdst_len;
# endif
if (w < width && (dp->flags & FLAG_LEFT))
if (w < width && (flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));
@ -2977,7 +2977,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* w doesn't matter. */
w = 0;
if (w < width && !(dp->flags & FLAG_LEFT))
if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));
@ -3033,7 +3033,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
length += tmpdst_len;
# endif
if (w < width && (dp->flags & FLAG_LEFT))
if (w < width && (flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));

View File

@ -222,7 +222,21 @@ template <int w>
/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */
#ifdef _GL_STATIC_ASSERT_H
# if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
/* Define _Static_assert if needed. */
/* With clang ≥ 3.8.0 in C++ mode, _Static_assert already works and accepts
1 or 2 arguments. We better don't override it, because clang's standard
C++ library uses static_assert inside classes in several places, and our
replacement via _GL_VERIFY does not work in these contexts. */
# if (defined __cplusplus && defined __clang__ \
&& (4 <= __clang_major__ + (8 <= __clang_minor__)))
# if 5 <= __clang_major__
/* Avoid "warning: 'static_assert' with no message is a C++17 extension". */
# pragma clang diagnostic ignored "-Wc++17-extensions"
# else
/* Avoid "warning: static_assert with no message is a C++1z extension". */
# pragma clang diagnostic ignored "-Wc++1z-extensions"
# endif
# elif !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
# if !defined _MSC_VER || defined __clang__
# define _Static_assert(...) \
_GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
@ -233,6 +247,7 @@ template <int w>
_GL_VERIFY ((R), "static assertion failed", -)
# endif
# endif
/* Define static_assert if needed. */
# if (!defined static_assert \
&& __STDC_VERSION__ < 202311 \
&& (!defined __cplusplus \
@ -250,6 +265,8 @@ template <int w>
# define _GL_SA3 static_assert
# define _GL_SA_PICK(x1,x2,x3,x4,...) x4
# define static_assert(...) _GL_EXPAND(_GL_SA_PICK(__VA_ARGS__,_GL_SA3,_GL_SA2,_GL_SA1)) (__VA_ARGS__)
/* Avoid "fatal error C1189: #error: The C++ Standard Library forbids macroizing keywords." */
# define _ALLOW_KEYWORD_MACROS 1
# else
# define static_assert _Static_assert /* C11 requires this #define. */
# endif

View File

@ -933,14 +933,11 @@ HAVE_GETUMASK = @HAVE_GETUMASK@
HAVE_GRANTPT = @HAVE_GRANTPT@
HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
HAVE_GSETTINGS = @HAVE_GSETTINGS@
<<<<<<< HEAD
HAVE_HYPOTF = @HAVE_HYPOTF@
HAVE_HYPOTL = @HAVE_HYPOTL@
HAVE_ILOGB = @HAVE_ILOGB@
HAVE_ILOGBF = @HAVE_ILOGBF@
HAVE_ILOGBL = @HAVE_ILOGBL@
=======
>>>>>>> origin/master
HAVE_IMAXABS = @HAVE_IMAXABS@
HAVE_IMAXDIV = @HAVE_IMAXDIV@
HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
@ -1051,7 +1048,6 @@ HAVE_SLEEP = @HAVE_SLEEP@
HAVE_SPAWN_H = @HAVE_SPAWN_H@
HAVE_SQRTF = @HAVE_SQRTF@
HAVE_SQRTL = @HAVE_SQRTL@
HAVE_STDALIGN_H = @HAVE_STDALIGN_H@
HAVE_STDINT_H = @HAVE_STDINT_H@
HAVE_STPCPY = @HAVE_STPCPY@
HAVE_STPNCPY = @HAVE_STPNCPY@
@ -1222,7 +1218,6 @@ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
NEXT_AS_FIRST_DIRECTIVE_STDALIGN_H = @NEXT_AS_FIRST_DIRECTIVE_STDALIGN_H@
NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
@ -1244,7 +1239,6 @@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
NEXT_LIMITS_H = @NEXT_LIMITS_H@
NEXT_MATH_H = @NEXT_MATH_H@
NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
NEXT_STDALIGN_H = @NEXT_STDALIGN_H@
NEXT_STDDEF_H = @NEXT_STDDEF_H@
NEXT_STDINT_H = @NEXT_STDINT_H@
NEXT_STDIO_H = @NEXT_STDIO_H@
@ -1393,7 +1387,6 @@ REPLACE_GETRANDOM = @REPLACE_GETRANDOM@
REPLACE_GETSUBOPT = @REPLACE_GETSUBOPT@
REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
REPLACE_GMTIME = @REPLACE_GMTIME@
<<<<<<< HEAD
REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
REPLACE_HYPOT = @REPLACE_HYPOT@
REPLACE_HYPOTF = @REPLACE_HYPOTF@
@ -1401,8 +1394,6 @@ REPLACE_HYPOTL = @REPLACE_HYPOTL@
REPLACE_ILOGB = @REPLACE_ILOGB@
REPLACE_ILOGBF = @REPLACE_ILOGBF@
REPLACE_ILOGBL = @REPLACE_ILOGBL@
=======
>>>>>>> origin/master
REPLACE_IMAXABS = @REPLACE_IMAXABS@
REPLACE_IMAXDIV = @REPLACE_IMAXDIV@
REPLACE_INITSTATE = @REPLACE_INITSTATE@
@ -1582,6 +1573,7 @@ SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@
SYSTEM_TYPE = @SYSTEM_TYPE@
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
TERMCAP_OBJ = @TERMCAP_OBJ@
TIFF_CFLAGS = @TIFF_CFLAGS@
TIMER_TIME_LIB = @TIMER_TIME_LIB@
TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
@ -3771,38 +3763,6 @@ EXTRA_DIST += stat-time.h
endif
## end gnulib module stat-time
<<<<<<< HEAD
## begin gnulib module stdalign
ifeq (,$(OMIT_GNULIB_MODULE_stdalign))
BUILT_SOURCES += $(STDALIGN_H)
# We need the following in order to create <stdalign.h> when the system
# doesn't have one that works.
ifneq (,$(GL_GENERATE_STDALIGN_H_CONDITION))
stdalign.h: stdalign.in.h $(top_builddir)/config.status
$(gl_V_at)$(SED_HEADER_STDOUT) \
-e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''HAVE_STDALIGN_H''@|$(HAVE_STDALIGN_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDALIGN_H''@|$(NEXT_STDALIGN_H)|g' \
$(srcdir)/stdalign.in.h > $@-t
$(AM_V_at)mv $@-t $@
else
stdalign.h: $(top_builddir)/config.status
rm -f $@
endif
MOSTLYCLEANFILES += stdalign.h stdalign.h-t
EXTRA_DIST += stdalign.in.h
endif
## end gnulib module stdalign
=======
>>>>>>> origin/master
## begin gnulib module stdckdint
ifeq (,$(OMIT_GNULIB_MODULE_stdckdint))

View File

@ -82,9 +82,10 @@ typedef union { DOUBLE value; unsigned int word[NWORDS]; } memory_double;
/* Most hosts nowadays use IEEE floating point, so they use IEC 60559
representations, have infinities and NaNs, and do not trap on
exceptions. Define IEEE_FLOATING_POINT if this host is one of the
typical ones. The C11 macro __STDC_IEC_559__ is close to what is
typical ones. The C23 macro __STDC_IEC_60559_BFP__ macro (or its cousin,
the now-obsolescent C11 macro __STDC_IEC_559__) is close to what is
wanted here, but is not quite right because this file does not require
all the features of C11 Annex F (and does not require C11 at all,
all the features of C23 Annex F (and works even with pre-C11 platforms,
for that matter). */
#define IEEE_FLOATING_POINT (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \

View File

@ -2130,7 +2130,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
}
if (characters < width && !(dp->flags & FLAG_LEFT))
if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2175,7 +2175,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
# endif
if (characters < width && (dp->flags & FLAG_LEFT))
if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2232,7 +2232,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
}
if (characters < width && !(dp->flags & FLAG_LEFT))
if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2277,7 +2277,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
# endif
if (characters < width && (dp->flags & FLAG_LEFT))
if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2334,7 +2334,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
}
if (characters < width && !(dp->flags & FLAG_LEFT))
if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2379,7 +2379,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
# endif
if (characters < width && (dp->flags & FLAG_LEFT))
if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2551,7 +2551,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
}
if (characters < width && !(dp->flags & FLAG_LEFT))
if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2612,7 +2612,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
if (characters < width && (dp->flags & FLAG_LEFT))
if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
@ -2768,7 +2768,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* w doesn't matter. */
w = 0;
if (w < width && !(dp->flags & FLAG_LEFT))
if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));
@ -2836,7 +2836,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
length += tmpdst_len;
# endif
if (w < width && (dp->flags & FLAG_LEFT))
if (w < width && (flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));
@ -2977,7 +2977,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* w doesn't matter. */
w = 0;
if (w < width && !(dp->flags & FLAG_LEFT))
if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));
@ -3033,7 +3033,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
length += tmpdst_len;
# endif
if (w < width && (dp->flags & FLAG_LEFT))
if (w < width && (flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));

View File

@ -265,6 +265,8 @@ template <int w>
# define _GL_SA3 static_assert
# define _GL_SA_PICK(x1,x2,x3,x4,...) x4
# define static_assert(...) _GL_EXPAND(_GL_SA_PICK(__VA_ARGS__,_GL_SA3,_GL_SA2,_GL_SA1)) (__VA_ARGS__)
/* Avoid "fatal error C1189: #error: The C++ Standard Library forbids macroizing keywords." */
# define _ALLOW_KEYWORD_MACROS 1
# else
# define static_assert _Static_assert /* C11 requires this #define. */
# endif

View File

@ -1,8 +1,4 @@
<<<<<<< HEAD
# gnulib-common.m4 serial 78
=======
# gnulib-common.m4 serial 80
>>>>>>> origin/master
dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@ -355,11 +351,6 @@ AC_DEFUN([gl_COMMON_BODY], [
in C++ also: class. */
/* In C++ and C23, this is spelled [[__maybe_unused__]].
GCC's syntax is __attribute__ ((__unused__)).
<<<<<<< HEAD
clang supports both syntaxes. */
#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
# ifdef __has_c_attribute
=======
clang supports both syntaxes. Except that with clang ≥ 6, < 10, in C++ mode,
__has_c_attribute (__maybe_unused__) yields true but the use of
[[__maybe_unused__]] nevertheless produces a warning. */
@ -369,7 +360,6 @@ AC_DEFUN([gl_COMMON_BODY], [
# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
# endif
# elif defined __has_c_attribute
>>>>>>> origin/master
# if __has_c_attribute (__maybe_unused__)
# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
# endif
@ -389,9 +379,6 @@ AC_DEFUN([gl_COMMON_BODY], [
the return value, unless the caller uses something like ignore_value. */
/* Applies to: function, enumeration, class. */
#ifndef _GL_ATTRIBUTE_NODISCARD
<<<<<<< HEAD
# ifdef __has_c_attribute
=======
# if defined __clang__ && defined __cplusplus
/* With clang up to 15.0.6 (at least), in C++ mode, [[__nodiscard__]] produces
a warning.
@ -402,7 +389,6 @@ AC_DEFUN([gl_COMMON_BODY], [
# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
# endif
# elif defined __has_c_attribute
>>>>>>> origin/master
# if __has_c_attribute (__nodiscard__)
# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
# endif

View File

@ -1123,12 +1123,9 @@ AC_DEFUN([gl_INIT],
if test $HAVE_FUTIMENS = 0 || test $REPLACE_FUTIMENS = 1; then
func_gl_gnulib_m4code_utimens
fi
<<<<<<< HEAD
if test $REPLACE_GETLINE = 1; then
func_gl_gnulib_m4code_getdelim
fi
=======
>>>>>>> origin/master
if case $host_os in mingw*) false;; *) test $HAVE_GETLOADAVG = 0 || test $REPLACE_GETLOADAVG = 1;; esac; then
func_gl_gnulib_m4code_open
fi