define mi_decl_align separate from mi_decl_cache_align

This commit is contained in:
daanx 2025-05-30 09:36:38 -07:00
parent 715acc0329
commit e19c022238

View file

@ -27,13 +27,14 @@ terms of the MIT license. A copy of the license can be found in the file
#define mi_trace_message(...)
#endif
#define MI_CACHE_LINE 64
#define mi_decl_cache_align mi_decl_align(64)
#if defined(_MSC_VER)
#pragma warning(disable:4127) // suppress constant conditional warning (due to MI_SECURE paths)
#pragma warning(disable:26812) // unscoped enum warning
#define mi_decl_noinline __declspec(noinline)
#define mi_decl_thread __declspec(thread)
#define mi_decl_cache_align __declspec(align(MI_CACHE_LINE))
#define mi_decl_align(a) __declspec(align(a))
#define mi_decl_noreturn __declspec(noreturn)
#define mi_decl_weak
#define mi_decl_hidden
@ -41,7 +42,7 @@ terms of the MIT license. A copy of the license can be found in the file
#elif (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(__clang__) // includes clang and icc
#define mi_decl_noinline __attribute__((noinline))
#define mi_decl_thread __thread
#define mi_decl_cache_align __attribute__((aligned(MI_CACHE_LINE)))
#define mi_decl_align(a) __attribute__((aligned(a)))
#define mi_decl_noreturn __attribute__((noreturn))
#define mi_decl_weak __attribute__((weak))
#define mi_decl_hidden __attribute__((visibility("hidden")))
@ -53,7 +54,7 @@ terms of the MIT license. A copy of the license can be found in the file
#elif __cplusplus >= 201103L // c++11
#define mi_decl_noinline
#define mi_decl_thread thread_local
#define mi_decl_cache_align alignas(MI_CACHE_LINE)
#define mi_decl_align(a) alignas(a)
#define mi_decl_noreturn [[noreturn]]
#define mi_decl_weak
#define mi_decl_hidden
@ -61,7 +62,7 @@ terms of the MIT license. A copy of the license can be found in the file
#else
#define mi_decl_noinline
#define mi_decl_thread __thread // hope for the best :-)
#define mi_decl_cache_align
#define mi_decl_align(a)
#define mi_decl_noreturn
#define mi_decl_weak
#define mi_decl_hidden