mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 12:32:21 +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
a4cc0703d1
commit
864ddfb55d
Notes:
github-actions[bot]
2025-04-15 08:20:20 +00:00
Author: https://github.com/ADKaster
Commit: 864ddfb55d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4360
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
Add a link
Reference in a new issue