Fixed build error

master
Christophe Riccio ago%!(EXTRA string=7 years)
parent b6321cb85e
commit bb0f4ef324
  1. 2
      CMakeLists.txt
  2. 60
      glm/detail/setup.hpp
  3. 2
      test/bug/bug_ms_vec_static.cpp

@ -155,7 +155,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
message("GLM: Visual C++ - ${CMAKE_CXX_COMPILER_ID} compiler") message("GLM: Visual C++ - ${CMAKE_CXX_COMPILER_ID} compiler")
add_compile_options(/FAs /W4 /WX) add_compile_options(/W4 /WX)
add_compile_options(/wd4309 /wd4324 /wd4389 /wd4127 /wd4267 /wd4146 /wd4201 /wd4464 /wd4514 /wd4701 /wd4820 /wd4365) add_compile_options(/wd4309 /wd4324 /wd4389 /wd4127 /wd4267 /wd4146 /wd4201 /wd4464 /wd4514 /wd4701 /wd4820 /wd4365)
add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif() endif()

@ -399,12 +399,12 @@
// nullptr // nullptr
#if GLM_LANG & GLM_LANG_CXX0X_FLAG #if GLM_LANG & GLM_LANG_CXX0X_FLAG
# define GLM_HAS_NULLPTR 1 # define GLM_USE_NULLPTR GLM_ENABLE
#else #else
# define GLM_HAS_NULLPTR 0 # define GLM_USE_NULLPTR GLM_DISABLE
#endif #endif
#if GLM_HAS_NULLPTR #if GLM_USE_NULLPTR == GLM_ENABLE
# define GLM_NULLPTR nullptr # define GLM_NULLPTR nullptr
#else #else
# define GLM_NULLPTR 0 # define GLM_NULLPTR 0
@ -433,12 +433,6 @@
# define GLM_CUDA_FUNC_DECL # define GLM_CUDA_FUNC_DECL
#endif #endif
#if GLM_COMPILER & GLM_COMPILER_GCC
# define GLM_VAR_USED __attribute__ ((unused))
#else
# define GLM_VAR_USED
#endif
#if defined(GLM_FORCE_INLINE) #if defined(GLM_FORCE_INLINE)
# if GLM_COMPILER & GLM_COMPILER_VC # if GLM_COMPILER & GLM_COMPILER_VC
# define GLM_INLINE __forceinline # define GLM_INLINE __forceinline
@ -518,49 +512,17 @@
#if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) #if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))
# define GLM_DEPRECATED __declspec(deprecated) # define GLM_DEPRECATED __declspec(deprecated)
# define GLM_ALIGN(x) __declspec(align(x))
# define GLM_ALIGNED_STRUCT(x) struct __declspec(align(x))
# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name
# define GLM_RESTRICT_FUNC __declspec(restrict)
# define GLM_RESTRICT __restrict
# if GLM_COMPILER >= GLM_COMPILER_VC12
# define GLM_VECTOR_CALL __vectorcall
# else
# define GLM_VECTOR_CALL
# endif
#elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL) #elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL)
# define GLM_DEPRECATED __attribute__((__deprecated__)) # define GLM_DEPRECATED __attribute__((__deprecated__))
# define GLM_ALIGN(x) __attribute__((aligned(x)))
# define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x)))
# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment))) # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment)))
# define GLM_RESTRICT_FUNC __restrict__
# define GLM_RESTRICT __restrict__
# if GLM_COMPILER & GLM_COMPILER_CLANG
# if GLM_COMPILER >= GLM_COMPILER_CLANG37
# define GLM_VECTOR_CALL __vectorcall
# else
# define GLM_VECTOR_CALL
# endif
# else
# define GLM_VECTOR_CALL
# endif
#elif GLM_COMPILER & GLM_COMPILER_CUDA #elif GLM_COMPILER & GLM_COMPILER_CUDA
# define GLM_DEPRECATED # define GLM_DEPRECATED
# define GLM_ALIGN(x) __align__(x)
# define GLM_ALIGNED_STRUCT(x) struct __align__(x)
# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x) # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x)
# define GLM_RESTRICT_FUNC __restrict__
# define GLM_RESTRICT __restrict__
# define GLM_VECTOR_CALL
#else #else
# define GLM_DEPRECATED # define GLM_DEPRECATED
# define GLM_ALIGN
# define GLM_ALIGNED_STRUCT(x) struct
# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name
# define GLM_RESTRICT_FUNC #endif
# define GLM_RESTRICT
# define GLM_VECTOR_CALL
#endif//GLM_COMPILER
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
@ -606,13 +568,6 @@ namespace glm
# define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0])
#endif #endif
///////////////////////////////////////////////////////////////////////////////////
// Check inclusions of different versions of GLM
#elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION))
# error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error."
#elif GLM_SETUP_INCLUDED == GLM_VERSION
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Configure the use of defaulted initialized types // Configure the use of defaulted initialized types
@ -665,6 +620,13 @@ namespace glm
# define GLM_USE_ANONYMOUS_STRUCT GLM_DISABLE # define GLM_USE_ANONYMOUS_STRUCT GLM_DISABLE
#endif #endif
///////////////////////////////////////////////////////////////////////////////////
// Check inclusions of different versions of GLM
#elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION))
# error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error."
#elif GLM_SETUP_INCLUDED == GLM_VERSION
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Messages // Messages

@ -1,6 +1,6 @@
#include <glm/glm.hpp> #include <glm/glm.hpp>
#if GLM_HAS_ANONYMOUS_STRUCT #if GLM_USE_ANONYMOUS_STRUCT == GLM_ENABLE
struct vec2; struct vec2;
struct _swizzle struct _swizzle

Loading…
Cancel
Save