mirror of
https://sourceware.org/git/glibc.git
synced 2025-11-05 08:10:46 +03:00
stdio: Only use __va_arg_pack if compiler supports it
Otherwise route __libc_message_wrapper to __libc_message_impl. Reviewed-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -184,18 +184,21 @@ _Noreturn void __libc_message_impl (const char *__vmaname, const char *__fmt,
|
|||||||
#define __libc_fatal_vma_name "glibc: fatal"
|
#define __libc_fatal_vma_name "glibc: fatal"
|
||||||
#define __libc_assert_vma_name "glibc: assert"
|
#define __libc_assert_vma_name "glibc: assert"
|
||||||
|
|
||||||
|
#ifdef __va_arg_pack
|
||||||
static inline _Noreturn void __libc_message_wrapper (const char *vmaname,
|
static inline _Noreturn void __libc_message_wrapper (const char *vmaname,
|
||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
{
|
{
|
||||||
#ifdef __va_arg_pack_len
|
|
||||||
if (__va_arg_pack_len () > LIBC_MESSAGE_MAX_ARGS)
|
if (__va_arg_pack_len () > LIBC_MESSAGE_MAX_ARGS)
|
||||||
{
|
{
|
||||||
__errordecl (__libc_message_error, "invalid number of arguments");
|
__errordecl (__libc_message_error, "invalid number of arguments");
|
||||||
__libc_message_error ();
|
__libc_message_error ();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
__libc_message_impl (vmaname, fmt, __va_arg_pack ());
|
__libc_message_impl (vmaname, fmt, __va_arg_pack ());
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
# define __libc_message_wrapper(__vmaname, __fmt, ...) \
|
||||||
|
__libc_message_impl (__vmaname, __fmt, __VA_ARGS__)
|
||||||
|
#endif
|
||||||
#define __libc_message(...) \
|
#define __libc_message(...) \
|
||||||
__libc_message_wrapper (__libc_fatal_vma_name, __VA_ARGS__)
|
__libc_message_wrapper (__libc_fatal_vma_name, __VA_ARGS__)
|
||||||
#define __libc_assert(...) \
|
#define __libc_assert(...) \
|
||||||
|
|||||||
Reference in New Issue
Block a user