mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00: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
2a15b85658
commit
a000912f39
1 changed files with 13 additions and 0 deletions
|
@ -247,6 +247,19 @@
|
|||
# define DISALLOW(message) __attribute__((error(message)))
|
||||
#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
|
||||
#ifndef __has_feature
|
||||
# define __has_feature(...) 0
|
||||
|
|
Loading…
Add table
Reference in a new issue