Avoid problems if countof() is already defined as a macro.

This commit is contained in:
Josh Gargus 2017-05-15 21:06:07 -07:00
parent 40398d67cd
commit b63ba72afa

View File

@ -765,12 +765,12 @@ namespace glm
namespace glm namespace glm
{ {
template<typename T, std::size_t N> template<typename T, std::size_t N>
constexpr std::size_t countof(T const (&)[N]) constexpr std::size_t _countof(T const (&)[N])
{ {
return N; return N;
} }
}//namespace glm }//namespace glm
# define GLM_COUNTOF(arr) glm::countof(arr) # define GLM_COUNTOF(arr) glm::_countof(arr)
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
# define GLM_COUNTOF(arr) _countof(arr) # define GLM_COUNTOF(arr) _countof(arr)
#else #else