mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Core: Integrate warning suppression macro helpers
This commit is contained in:
parent
1f56d96cf2
commit
207a2b6472
25 changed files with 119 additions and 180 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue