diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 5087e3e..6280aa6 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -42,6 +42,11 @@ #include #include +// Checks magic_enum compiler compatibility. +#if defined(__clang__) || defined(__GNUC__) && __GNUC__>= 9 || defined(_MSC_VER) +# define MAGIC_ENUM_SUPPORTED 1 +#endif + // Enum value must be greater or equals than MAGIC_ENUM_RANGE_MIN. By default MAGIC_ENUM_RANGE_MIN = -128. // If need another min range for all enum types by default, redefine the macro MAGIC_ENUM_RANGE_MIN. #if !defined(MAGIC_ENUM_RANGE_MIN) @@ -56,10 +61,6 @@ namespace magic_enum { -#if defined(__clang__) || defined(__GNUC__) && __GNUC__>= 9 || defined(_MSC_VER) -# define MAGIC_ENUM_SUPPORTED 1 -#endif - // Enum value must be in range [MAGIC_ENUM_RANGE_MIN, MAGIC_ENUM_RANGE_MAX]. By default MAGIC_ENUM_RANGE_MIN = -128, MAGIC_ENUM_RANGE_MAX = 128. // If need another range for all enum types by default, redefine the macro MAGIC_ENUM_RANGE_MIN and MAGIC_ENUM_RANGE_MAX. // If need another range for specific enum type, add specialization enum_range for necessary enum type.