mirror of
https://github.com/g-truc/glm.git
synced 2024-11-30 03:44:38 +00:00
Factorised code, reduces number of warnings
This commit is contained in:
parent
e09a1f497e
commit
441f8a6575
@ -24,6 +24,16 @@ namespace detail
|
||||
#elif(GLM_COMPILER & GLM_COMPILER_GCC)
|
||||
__extension__ typedef signed long long sint64;
|
||||
__extension__ typedef unsigned long long uint64;
|
||||
//# if GLM_MODEL == GLM_MODEL_64
|
||||
// typedef signed long highp_int_t;
|
||||
// typedef unsigned long highp_uint_t;
|
||||
//# elif GLM_MODEL == GLM_MODEL_32
|
||||
// __extension__ typedef signed long long highp_int_t;
|
||||
// __extension__ typedef unsigned long long highp_uint_t;
|
||||
//# endif//GLM_MODEL
|
||||
#elif(GLM_COMPILER & GLM_COMPILER_BC)
|
||||
typedef Int64 sint64;
|
||||
typedef Uint64 uint64;
|
||||
#else//unknown compiler
|
||||
typedef signed long sint64;
|
||||
typedef unsigned long uint64;
|
||||
|
@ -17,26 +17,13 @@ namespace glm
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
#if defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC)
|
||||
typedef signed __int64 highp_int_t;
|
||||
typedef unsigned __int64 highp_uint_t;
|
||||
#elif(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_GCC))
|
||||
__extension__ typedef signed long long highp_int_t;
|
||||
__extension__ typedef unsigned long long highp_uint_t;
|
||||
//# if GLM_MODEL == GLM_MODEL_64
|
||||
// typedef signed long highp_int_t;
|
||||
// typedef unsigned long highp_uint_t;
|
||||
//# elif GLM_MODEL == GLM_MODEL_32
|
||||
// __extension__ typedef signed long long highp_int_t;
|
||||
// __extension__ typedef unsigned long long highp_uint_t;
|
||||
//# endif//GLM_MODEL
|
||||
#elif(defined(GLM_COMPILER_BC))
|
||||
typedef Int64 highp_int_t;
|
||||
typedef Uint64 highp_uint_t;
|
||||
#else
|
||||
typedef signed long long highp_int_t;
|
||||
typedef unsigned long long highp_uint_t;
|
||||
#endif//GLM_COMPILER
|
||||
typedef signed short lowp_int_t;
|
||||
typedef signed int mediump_int_t;
|
||||
typedef sint64 highp_int_t;
|
||||
|
||||
typedef unsigned short lowp_uint_t;
|
||||
typedef unsigned int mediump_uint_t;
|
||||
typedef uint64 highp_uint_t;
|
||||
|
||||
GLM_DETAIL_IS_INT(signed char);
|
||||
GLM_DETAIL_IS_INT(signed short);
|
||||
@ -49,14 +36,6 @@ namespace glm
|
||||
GLM_DETAIL_IS_UINT(unsigned int);
|
||||
GLM_DETAIL_IS_UINT(unsigned long);
|
||||
GLM_DETAIL_IS_UINT(highp_uint_t);
|
||||
|
||||
typedef signed short lowp_int_t;
|
||||
typedef signed int mediump_int_t;
|
||||
typedef detail::highp_int_t highp_int_t;
|
||||
|
||||
typedef unsigned short lowp_uint_t;
|
||||
typedef unsigned int mediump_uint_t;
|
||||
typedef detail::highp_uint_t highp_uint_t;
|
||||
}
|
||||
//namespace detail
|
||||
|
||||
|
24
glm/glm.hpp
24
glm/glm.hpp
@ -95,18 +95,20 @@ namespace glm
|
||||
|
||||
////////////////////
|
||||
// check type sizes
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::int8) == 1, "int8 size isn't 1 byte on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::int16) == 2, "int16 size isn't 2 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::int32) == 4, "int32 size isn't 4 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::int64) == 8, "int64 size isn't 8 bytes on this platform");
|
||||
#ifndef GLM_STATIC_ASSERT_NULL
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::int8) == 1, "int8 size isn't 1 byte on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::int16) == 2, "int16 size isn't 2 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::int32) == 4, "int32 size isn't 4 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::int64) == 8, "int64 size isn't 8 bytes on this platform");
|
||||
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::uint8) == 1, "uint8 size isn't 1 byte on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::uint8) == 1, "uint8 size isn't 1 byte on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
|
||||
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::float16) == 2, "float16 size isn't 2 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::float32) == 4, "float32 size isn't 4 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::float64) == 8, "float64 size isn't 8 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::float16) == 2, "float16 size isn't 2 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::float32) == 4, "float32 size isn't 4 bytes on this platform");
|
||||
GLM_STATIC_ASSERT(sizeof(glm::detail::float64) == 8, "float64 size isn't 8 bytes on this platform");
|
||||
#endif//GLM_STATIC_ASSERT_NULL
|
||||
|
||||
#endif //glm_glm
|
||||
|
@ -365,6 +365,7 @@
|
||||
# define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
|
||||
#else
|
||||
# define GLM_STATIC_ASSERT(x, message)
|
||||
# define GLM_STATIC_ASSERT_NULL
|
||||
#endif//GLM_LANG
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user