Core: Integrate warning suppression macro helpers

This commit is contained in:
Thaddeus Crews 2025-03-31 10:56:33 -05:00
parent 1f56d96cf2
commit 207a2b6472
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
25 changed files with 119 additions and 180 deletions

View file

@ -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.

View file

@ -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;