mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Always assume that we use a gnu/c99 printf implementation
On Windows we use gnulib and elsewhere we use glibc or similar. Also change G_GNUC_PRINTF to use gnu_printf instead of __format__ if possible because __format__ evaluates to ms_printf under MinGW, but we use gnulib there and not the system printf. gnu_printf is only available with GCC>=4.4 and not with clang. https://bugzilla.gnome.org/show_bug.cgi?id=795569
This commit is contained in:
parent
b437a13a70
commit
98a0ab929d
@ -146,10 +146,17 @@
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
||||
#if !defined (__clang__) && G_GNUC_CHECK_VERSION (4, 4)
|
||||
#define G_GNUC_PRINTF( format_idx, arg_idx ) \
|
||||
__attribute__((__format__ (gnu_printf, format_idx, arg_idx)))
|
||||
#define G_GNUC_SCANF( format_idx, arg_idx ) \
|
||||
__attribute__((__format__ (gnu_scanf, format_idx, arg_idx)))
|
||||
#else
|
||||
#define G_GNUC_PRINTF( format_idx, arg_idx ) \
|
||||
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
|
||||
#define G_GNUC_SCANF( format_idx, arg_idx ) \
|
||||
__attribute__((__format__ (__scanf__, format_idx, arg_idx)))
|
||||
#endif
|
||||
#define G_GNUC_FORMAT( arg_idx ) \
|
||||
__attribute__((__format_arg__ (arg_idx)))
|
||||
#define G_GNUC_NORETURN \
|
||||
|
11
meson.build
11
meson.build
@ -1043,14 +1043,7 @@ else
|
||||
ssizet_size = cc.sizeof('ssize_t')
|
||||
endif
|
||||
|
||||
# On Windows, MSVC supports both ll and I64 as format specifiers for 64-bit
|
||||
# integers, but some versions (at least 4.7.x) of MinGW only support I64.
|
||||
if host_system == 'windows'
|
||||
int64_m = 'I64'
|
||||
else
|
||||
int64_m = 'll'
|
||||
endif
|
||||
|
||||
int64_m = 'll'
|
||||
char_align = cc.alignment('char')
|
||||
short_align = cc.alignment('short')
|
||||
int_align = cc.alignment('int')
|
||||
@ -1160,7 +1153,7 @@ if host_system == 'windows'
|
||||
glibconfig_conf.set('g_pid_type', 'void*')
|
||||
glibconfig_conf.set_quoted('g_pid_format', 'p')
|
||||
if host_machine.cpu_family() == 'x86_64'
|
||||
glibconfig_conf.set_quoted('g_pollfd_format', '%#I64x')
|
||||
glibconfig_conf.set_quoted('g_pollfd_format', '%#' + int64_m + 'x')
|
||||
else
|
||||
glibconfig_conf.set_quoted('g_pollfd_format', '%#x')
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user