Added MIJIN_RTTI macro for detecting if RTTI is available.

This commit is contained in:
Patrick Wuttke 2025-08-30 00:28:19 +02:00
parent e91184ec82
commit b44d6feb97

View File

@ -61,6 +61,26 @@ namespace mijin
#endif #endif
#endif #endif
#if !defined(MIJIN_RTTI)
#if MIJIN_COMPILER == MIJIN_COMPILER_GCC
#if defined(__GXX_RTTI)
#define MIJIN_RTTI 1
#else
#define MIJIN_RTTI 0
#endif
#elif MIJIN_COMPILER == MIJIN_COMPILER_CLANG
#define MIJIN_RTTI (__has_feature(cxx_rtti))
#elif MIJIN_COMPILER == MIJIN_COMPILER_MSVC
#if defined(_CPPRTTI)
#define MIJIN_RTTI 1
#else
#define MIJIN_RTTI 0
#endif
#else
#define MIJIN_RTTI 0
#endif
#endif
// //
// public constants // public constants
// //