mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-01 21:33:09 +02:00
Merge branch 'ms-bitfield' into 'main'
meson: warn if -mms-bitfields is necessary See merge request GNOME/glib!3519
This commit is contained in:
commit
da47d030d4
14
meson.build
14
meson.build
@ -2358,6 +2358,20 @@ if host_system == 'windows' and cc.get_id() != 'msvc' and cc.get_id() != 'clang-
|
|||||||
# Ensure MSVC-compatible struct packing convention is used when
|
# Ensure MSVC-compatible struct packing convention is used when
|
||||||
# compiling for Win32 with gcc. It is used for the whole project and exposed
|
# compiling for Win32 with gcc. It is used for the whole project and exposed
|
||||||
# in glib-2.0.pc.
|
# in glib-2.0.pc.
|
||||||
|
if not cc.compiles('''
|
||||||
|
struct _GTestMSBitfields
|
||||||
|
{
|
||||||
|
int a : 1;
|
||||||
|
short b : 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef char _StaticCheck[sizeof(struct _GTestMSBitfields) != sizeof(int) ? 1 : -1];
|
||||||
|
''')
|
||||||
|
warning('''
|
||||||
|
Your compiler does not have ms-bitfields packing by default.
|
||||||
|
Please use gcc >= 4.7 or clang >= 12: GLib will drop -mms-bitfields in the future.
|
||||||
|
''')
|
||||||
|
endif
|
||||||
win32_cflags = ['-mms-bitfields']
|
win32_cflags = ['-mms-bitfields']
|
||||||
add_project_arguments(win32_cflags, language : 'c')
|
add_project_arguments(win32_cflags, language : 'c')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user