29 #ifndef glm_core_detail
30 #define glm_core_detail
34 #if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
43 #if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
46 #elif(GLM_COMPILER & GLM_COMPILER_VC)
47 typedef signed __int64 sint64;
48 typedef unsigned __int64 uint64;
49 #elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC | GLM_COMPILER_CLANG))
50 __extension__
typedef signed long long sint64;
51 __extension__
typedef unsigned long long uint64;
52 #elif(GLM_COMPILER & GLM_COMPILER_BC)
54 typedef Uint64 uint64;
55 #else//unknown compiler
56 typedef signed long long sint64;
57 typedef unsigned long long uint64;
63 template<
typename F,
typename T>
64 static GLM_FUNC_QUALIFIER T apply(F functor,
const T& val)
73 template<
typename F,
typename T>
74 static GLM_FUNC_QUALIFIER T apply(F,
const T& val)
135 GLM_FUNC_QUALIFIER uif32() :
139 GLM_FUNC_QUALIFIER uif32(
float f) :
143 GLM_FUNC_QUALIFIER uif32(
unsigned int i) :
153 GLM_FUNC_QUALIFIER uif64() :
157 GLM_FUNC_QUALIFIER uif64(
double f) :
161 GLM_FUNC_QUALIFIER uif64(uint64 i) :
174 template <
typename T>
184 #define GLM_DETAIL_IS_INT(T) \
198 template <
typename T>
208 #define GLM_DETAIL_IS_UINT(T) \
224 template <
typename T>
234 #define GLM_DETAIL_IS_FLOAT(T) \
246 GLM_DETAIL_IS_FLOAT(
float);
247 GLM_DETAIL_IS_FLOAT(
double);
248 GLM_DETAIL_IS_FLOAT(
long double);
253 template <
typename T>
276 template <
typename T>
286 # define GLM_DETAIL_IS_VECTOR(TYPE) \
287 template <typename T> \
288 struct is_vector<TYPE<T> > \
290 enum is_vector_enum \
300 template <
typename T>
310 #define GLM_DETAIL_IS_MATRIX(T) \
314 enum is_matrix_enum \
324 template <
typename T>
329 is_float = is_float<T>::_YES,
330 is_int = is_int<T>::_YES,
331 is_uint = is_uint<T>::_YES,
332 is_bool = is_bool<T>::_YES
339 typedef signed char int8;
340 typedef signed short int16;
341 typedef signed int int32;
342 typedef detail::sint64 int64;
344 typedef unsigned char uint8;
345 typedef unsigned short uint16;
346 typedef unsigned int uint32;
347 typedef detail::uint64 uint64;
350 typedef float float32;
351 typedef double float64;
356 struct float_or_int_value
366 template <
typename T>
367 struct float_or_int_trait
369 enum{ID = float_or_int_value::GLM_ERROR};
373 struct float_or_int_trait<int8>
375 enum{ID = float_or_int_value::GLM_INT};
379 struct float_or_int_trait<int16>
381 enum{ID = float_or_int_value::GLM_INT};
385 struct float_or_int_trait<int32>
387 enum{ID = float_or_int_value::GLM_INT};
391 struct float_or_int_trait<int64>
393 enum{ID = float_or_int_value::GLM_INT};
397 struct float_or_int_trait<uint8>
399 enum{ID = float_or_int_value::GLM_INT};
403 struct float_or_int_trait<uint16>
405 enum{ID = float_or_int_value::GLM_INT};
409 struct float_or_int_trait<uint32>
411 enum{ID = float_or_int_value::GLM_INT};
415 struct float_or_int_trait<uint64>
417 enum{ID = float_or_int_value::GLM_INT};
421 struct float_or_int_trait<float16>
423 enum{ID = float_or_int_value::GLM_FLOAT};
427 struct float_or_int_trait<float32>
429 enum{ID = float_or_int_value::GLM_FLOAT};
433 struct float_or_int_trait<float64>
435 enum{ID = float_or_int_value::GLM_FLOAT};
441 #if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2005))
442 # define GLM_DEPRECATED __declspec(deprecated)
443 # define GLM_ALIGN(x) __declspec(align(x))
444 # define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct
445 # define GLM_RESTRICT __declspec(restrict)
446 # define GLM_RESTRICT_VAR __restrict
447 # define GLM_CONSTEXPR
448 #elif((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31))
449 # define GLM_DEPRECATED __attribute__((__deprecated__))
450 # define GLM_ALIGN(x) __attribute__((aligned(x)))
451 # define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x)))
452 # if(GLM_COMPILER >= GLM_COMPILER_GCC33)
453 # define GLM_RESTRICT __restrict__
454 # define GLM_RESTRICT_VAR __restrict__
456 # define GLM_RESTRICT
457 # define GLM_RESTRICT_VAR
459 # define GLM_RESTRICT __restrict__
460 # define GLM_RESTRICT_VAR __restrict__
461 # if((GLM_COMPILER >= GLM_COMPILER_GCC47) && ((GLM_LANG & GLM_LANG_CXX0X) == GLM_LANG_CXX0X))
462 # define GLM_CONSTEXPR constexpr
464 # define GLM_CONSTEXPR
467 # define GLM_DEPRECATED
469 # define GLM_ALIGNED_STRUCT(x)
470 # define GLM_RESTRICT
471 # define GLM_RESTRICT_VAR
472 # define GLM_CONSTEXPR
475 #endif//glm_core_detail