From cbbb6dd8f1954b08759c747fe09ae9f3923d0ce4 Mon Sep 17 00:00:00 2001 From: neargye Date: Wed, 2 Oct 2019 17:52:04 +0500 Subject: [PATCH] add comment to MAGIC_ENUM_SUPPORTED --- include/magic_enum.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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.