diff --git a/example/example.cpp b/example/example.cpp index 9edbe85..67ed9cc 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -1,4 +1,4 @@ -// nameof c++ example +// nameof example // // Licensed under the MIT License . // Copyright (c) 2018 Daniil Goncharov . diff --git a/include/nameof.hpp b/include/nameof.hpp index 8f8587e..f024d5d 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -52,19 +52,13 @@ inline constexpr const char* Nameof(const char* name, const std::size_t length, } // namespace nameof #if defined(__GNUC__) || defined(__clang__) - // Used to obtain the string name of a variable, type, function, macros and etc. -#define NAMEOF(name) ::nameof::Nameof(#name, sizeof(#name) / sizeof(char) - 1, sizeof(void(*)(__typeof__(name)))) - +# define NAMEOF(name) ::nameof::Nameof(#name, sizeof(#name) / sizeof(char) - 1, sizeof(void(*)(__typeof__(name)))) // Used to obtain the string full name of a variable, type, function, macros and etc. -#define NAMEOF_FULL(name) ::nameof::Nameof(#name, 0, sizeof(void(*)(__typeof__(name)))) - -#else - +# define NAMEOF_FULL(name) ::nameof::Nameof(#name, 0, sizeof(void(*)(__typeof__(name)))) +#elif defined(_MSC_VER) // Used to obtain the string name of a variable, type, function, macros and etc. -#define NAMEOF(name) ::nameof::Nameof(#name, sizeof(#name) / sizeof(char) - 1, sizeof(typeid(name))) - +# define NAMEOF(name) ::nameof::Nameof(#name, sizeof(#name) / sizeof(char) - 1, sizeof(typeid(name))) // Used to obtain the string full name of a variable, type, function, macros and etc. -#define NAMEOF_FULL(name) ::nameof::Nameof(#name, 0, sizeof(typeid(name))) - +# define NAMEOF_FULL(name) ::nameof::Nameof(#name, 0, sizeof(typeid(name))) #endif diff --git a/test/test.cpp b/test/test.cpp index 9c1136a..c6af55d 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -1,4 +1,4 @@ -// nameof c++ test +// nameof test // // Licensed under the MIT License . // Copyright (c) 2018 Daniil Goncharov .