mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
AK: Add macro to switch between no_unique_address attribute forms
Also add an escape hatch for completely disabling the annotation.
This commit is contained in:
parent
a4cc0703d1
commit
864ddfb55d
|
|
@ -247,6 +247,19 @@
|
||||||
# define DISALLOW(message) __attribute__((error(message)))
|
# define DISALLOW(message) __attribute__((error(message)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef NO_UNIQUE_ADDRESS
|
||||||
|
# undef NO_UNIQUE_ADDRESS
|
||||||
|
#endif
|
||||||
|
#if defined(AK_DISABLE_NO_UNIQUE_ADDRESS)
|
||||||
|
# define NO_UNIQUE_ADDRESS
|
||||||
|
#else
|
||||||
|
# if defined(AK_OS_WINDOWS)
|
||||||
|
# define NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
|
||||||
|
# else
|
||||||
|
# define NO_UNIQUE_ADDRESS [[no_unique_address]]
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// GCC doesn't have __has_feature but clang does
|
// GCC doesn't have __has_feature but clang does
|
||||||
#ifndef __has_feature
|
#ifndef __has_feature
|
||||||
# define __has_feature(...) 0
|
# define __has_feature(...) 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user