@@ -338,4 +338,47 @@ struct is_zero_constructible<const volatile T> : is_zero_constructible<T> {};
338338template <typename T>
339339inline constexpr bool is_zero_constructible_v = is_zero_constructible<T>::value;
340340
341+ // Warning suppression helper macros.
342+ #if defined(__clang__)
343+ #define GODOT_CLANG_PRAGMA (m_content ) _Pragma (#m_content)
344+ #define GODOT_CLANG_WARNING_PUSH GODOT_CLANG_PRAGMA (clang diagnostic push)
345+ #define GODOT_CLANG_WARNING_IGNORE (m_warning ) GODOT_CLANG_PRAGMA(clang diagnostic ignored m_warning)
346+ #define GODOT_CLANG_WARNING_POP GODOT_CLANG_PRAGMA (clang diagnostic pop)
347+ #define GODOT_CLANG_WARNING_PUSH_AND_IGNORE (m_warning ) GODOT_CLANG_WARNING_PUSH GODOT_CLANG_WARNING_IGNORE (m_warning)
348+ #else
349+ #define GODOT_CLANG_PRAGMA (m_content )
350+ #define GODOT_CLANG_WARNING_PUSH
351+ #define GODOT_CLANG_WARNING_IGNORE (m_warning )
352+ #define GODOT_CLANG_WARNING_POP
353+ #define GODOT_CLANG_WARNING_PUSH_AND_IGNORE (m_warning )
354+ #endif
355+
356+ #if defined(__GNUC__) && !defined(__clang__)
357+ #define GODOT_GCC_PRAGMA (m_content ) _Pragma (#m_content)
358+ #define GODOT_GCC_WARNING_PUSH GODOT_GCC_PRAGMA (GCC diagnostic push)
359+ #define GODOT_GCC_WARNING_IGNORE (m_warning ) GODOT_GCC_PRAGMA(GCC diagnostic ignored m_warning)
360+ #define GODOT_GCC_WARNING_POP GODOT_GCC_PRAGMA (GCC diagnostic pop)
361+ #define GODOT_GCC_WARNING_PUSH_AND_IGNORE (m_warning ) GODOT_GCC_WARNING_PUSH GODOT_GCC_WARNING_IGNORE (m_warning)
362+ #else
363+ #define GODOT_GCC_PRAGMA (m_content )
364+ #define GODOT_GCC_WARNING_PUSH
365+ #define GODOT_GCC_WARNING_IGNORE (m_warning )
366+ #define GODOT_GCC_WARNING_POP
367+ #define GODOT_GCC_WARNING_PUSH_AND_IGNORE (m_warning )
368+ #endif
369+
370+ #if defined(_MSC_VER) && !defined(__clang__)
371+ #define GODOT_MSVC_PRAGMA (m_content ) __pragma(m_content)
372+ #define GODOT_MSVC_WARNING_PUSH GODOT_MSVC_PRAGMA (warning(push))
373+ #define GODOT_MSVC_WARNING_IGNORE (m_warning ) GODOT_MSVC_PRAGMA(warning(disable : m_warning))
374+ #define GODOT_MSVC_WARNING_POP GODOT_MSVC_PRAGMA (warning(pop))
375+ #define GODOT_MSVC_WARNING_PUSH_AND_IGNORE (m_warning ) GODOT_MSVC_WARNING_PUSH GODOT_MSVC_WARNING_IGNORE (m_warning)
376+ #else
377+ #define GODOT_MSVC_PRAGMA (m_content )
378+ #define GODOT_MSVC_WARNING_PUSH
379+ #define GODOT_MSVC_WARNING_IGNORE (m_warning )
380+ #define GODOT_MSVC_WARNING_POP
381+ #define GODOT_MSVC_WARNING_PUSH_AND_IGNORE (m_warning )
382+ #endif
383+
341384} // namespace godot
0 commit comments