Core: Integrate warning suppression macro helpers
This commit is contained in:
@ -36,10 +36,7 @@
|
||||
|
||||
#ifdef THREADS_ENABLED
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wundefined-var-template"
|
||||
#endif
|
||||
GODOT_CLANG_WARNING_PUSH_AND_IGNORE("-Wundefined-var-template")
|
||||
|
||||
// A very special kind of mutex, used in scenarios where these
|
||||
// requirements hold at the same time:
|
||||
@ -119,9 +116,7 @@ public:
|
||||
// TODO: Implement a `try_temp_relock` if needed (will also need a dummy method below).
|
||||
};
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
GODOT_CLANG_WARNING_POP
|
||||
|
||||
#else // No threads.
|
||||
|
||||
|
||||
@ -92,14 +92,9 @@ public:
|
||||
};
|
||||
|
||||
#if defined(__cpp_lib_hardware_interference_size) && !defined(ANDROID_ENABLED) // This would be OK with NDK >= 26.
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Winterference-size"
|
||||
#endif
|
||||
GODOT_GCC_WARNING_PUSH_AND_IGNORE("-Winterference-size")
|
||||
static constexpr size_t CACHE_LINE_BYTES = std::hardware_destructive_interference_size;
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
GODOT_GCC_WARNING_POP
|
||||
#else
|
||||
// At a negligible memory cost, we use a conservatively high value.
|
||||
static constexpr size_t CACHE_LINE_BYTES = 128;
|
||||
|
||||
Reference in New Issue
Block a user