mirror of
https://github.com/g-truc/glm.git
synced 2024-11-23 01:14:34 +00:00
Merge branch 'master' of https://github.com/g-truc/glm
This commit is contained in:
commit
0671e609bb
@ -63,27 +63,16 @@ if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}"
|
|||||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++98")
|
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++98")
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
|
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
|
||||||
set(CMAKE_CXX_FLAGS "-std=c++98")
|
set(CMAKE_CXX_FLAGS "-std=c++98")
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
||||||
# GLM is using GCC 64 bits integer extension
|
|
||||||
add_definitions(-Wno-long-long)
|
|
||||||
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
||||||
add_definitions(-Wno-c++11-long-long)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(GLM_TEST_ENABLE_MS_EXTENSIONS "Enable MS extensions" OFF)
|
option(GLM_TEST_ENABLE_LANG_EXTENSIONS "Enable language extensions" OFF)
|
||||||
|
|
||||||
if(GLM_TEST_ENABLE_MS_EXTENSIONS)
|
if(NOT GLM_TEST_ENABLE_LANG_EXTENSIONS)
|
||||||
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"))
|
|
||||||
add_definitions(-Wgnu-anonymous-struct)
|
|
||||||
add_definitions(-Wnested-anon-types)
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") OR (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") AND WIN32))
|
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") OR (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") AND WIN32))
|
||||||
add_definitions(/Za)
|
add_definitions(/Za)
|
||||||
# elseif(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"))
|
elseif(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"))
|
||||||
# add_definitions(-pedantic)
|
add_definitions(-pedantic)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -29,12 +29,29 @@ namespace detail
|
|||||||
# if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
|
# if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
|
||||||
typedef int64_t sint64;
|
typedef int64_t sint64;
|
||||||
typedef uint64_t uint64;
|
typedef uint64_t uint64;
|
||||||
|
|
||||||
# elif GLM_COMPILER & GLM_COMPILER_VC
|
# elif GLM_COMPILER & GLM_COMPILER_VC
|
||||||
typedef signed __int64 sint64;
|
typedef signed __int64 sint64;
|
||||||
typedef unsigned __int64 uint64;
|
typedef unsigned __int64 uint64;
|
||||||
|
|
||||||
# elif GLM_COMPILER & GLM_COMPILER_GCC
|
# elif GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wno-long-long"
|
||||||
|
|
||||||
__extension__ typedef signed long long sint64;
|
__extension__ typedef signed long long sint64;
|
||||||
__extension__ typedef unsigned long long uint64;
|
__extension__ typedef unsigned long long uint64;
|
||||||
|
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
|
||||||
|
# elif GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic push
|
||||||
|
# pragma clang diagnostic ignored "-Wno-c++11-long-long"
|
||||||
|
|
||||||
|
typedef signed long long sint64;
|
||||||
|
typedef unsigned long long uint64;
|
||||||
|
|
||||||
|
# pragma clang diagnostic pop
|
||||||
|
|
||||||
# else//unknown compiler
|
# else//unknown compiler
|
||||||
typedef signed long long sint64;
|
typedef signed long long sint64;
|
||||||
typedef unsigned long long uint64;
|
typedef unsigned long long uint64;
|
||||||
|
@ -31,7 +31,7 @@ namespace glm
|
|||||||
template <precision Q>
|
template <precision Q>
|
||||||
GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
|
GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
|
||||||
|
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat4x4(ctor);
|
GLM_FUNC_DECL explicit tmat4x4(ctor);
|
||||||
GLM_FUNC_DECL explicit tmat4x4(T const & x);
|
GLM_FUNC_DECL explicit tmat4x4(T const & x);
|
||||||
GLM_FUNC_DECL tmat4x4(
|
GLM_FUNC_DECL tmat4x4(
|
||||||
T const & x0, T const & y0, T const & z0, T const & w0,
|
T const & x0, T const & y0, T const & z0, T const & w0,
|
||||||
|
@ -42,7 +42,7 @@ namespace glm
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat4x4<T, P>::tmat4x4(ctor)
|
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(ctor)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
|
@ -27,7 +27,17 @@ namespace glm
|
|||||||
|
|
||||||
// -- Data --
|
// -- Data --
|
||||||
|
|
||||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
|
# endif
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic push
|
||||||
|
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||||
|
# pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||||
|
# endif
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
T x;
|
T x;
|
||||||
@ -46,6 +56,13 @@ namespace glm
|
|||||||
_GLM_SWIZZLE1_4_MEMBERS(T, P, tvec4, s)
|
_GLM_SWIZZLE1_4_MEMBERS(T, P, tvec4, s)
|
||||||
# endif//GLM_SWIZZLE*/
|
# endif//GLM_SWIZZLE*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic pop
|
||||||
|
# endif
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
# endif
|
||||||
# else
|
# else
|
||||||
union {T x, r, s;};
|
union {T x, r, s;};
|
||||||
/*
|
/*
|
||||||
|
@ -26,7 +26,17 @@ namespace glm
|
|||||||
|
|
||||||
// -- Data --
|
// -- Data --
|
||||||
|
|
||||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
|
# endif
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic push
|
||||||
|
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||||
|
# pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||||
|
# endif
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct{ T x, y; };
|
struct{ T x, y; };
|
||||||
@ -46,6 +56,13 @@ namespace glm
|
|||||||
# endif//GLM_SWIZZLE
|
# endif//GLM_SWIZZLE
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic pop
|
||||||
|
# endif
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
# endif
|
||||||
# else
|
# else
|
||||||
union {T x, r, s;};
|
union {T x, r, s;};
|
||||||
union {T y, g, t;};
|
union {T y, g, t;};
|
||||||
|
@ -26,7 +26,17 @@ namespace glm
|
|||||||
|
|
||||||
// -- Data --
|
// -- Data --
|
||||||
|
|
||||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
|
# endif
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic push
|
||||||
|
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||||
|
# pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||||
|
# endif
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct{ T x, y, z; };
|
struct{ T x, y, z; };
|
||||||
@ -45,6 +55,13 @@ namespace glm
|
|||||||
_GLM_SWIZZLE3_4_MEMBERS(T, P, glm::tvec4, s, t, p)
|
_GLM_SWIZZLE3_4_MEMBERS(T, P, glm::tvec4, s, t, p)
|
||||||
# endif//GLM_SWIZZLE
|
# endif//GLM_SWIZZLE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic pop
|
||||||
|
# endif
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
# endif
|
||||||
# else
|
# else
|
||||||
union { T x, r, s; };
|
union { T x, r, s; };
|
||||||
union { T y, g, t; };
|
union { T y, g, t; };
|
||||||
|
@ -27,7 +27,17 @@ namespace glm
|
|||||||
|
|
||||||
// -- Data --
|
// -- Data --
|
||||||
|
|
||||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
|
# endif
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic push
|
||||||
|
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||||
|
# pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||||
|
# endif
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct { T x, y, z, w;};
|
struct { T x, y, z, w;};
|
||||||
@ -48,6 +58,13 @@ namespace glm
|
|||||||
_GLM_SWIZZLE4_4_MEMBERS(T, P, glm::tvec4, s, t, p, q)
|
_GLM_SWIZZLE4_4_MEMBERS(T, P, glm::tvec4, s, t, p, q)
|
||||||
# endif//GLM_SWIZZLE
|
# endif//GLM_SWIZZLE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic pop
|
||||||
|
# endif
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
# endif
|
||||||
# else
|
# else
|
||||||
union { T x, r, s; };
|
union { T x, r, s; };
|
||||||
union { T y, g, t; };
|
union { T y, g, t; };
|
||||||
|
@ -40,12 +40,29 @@ namespace glm
|
|||||||
|
|
||||||
// -- Data --
|
// -- Data --
|
||||||
|
|
||||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
|
# endif
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic push
|
||||||
|
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||||
|
# pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||||
|
# endif
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct { T x, y, z, w;};
|
struct { T x, y, z, w;};
|
||||||
typename detail::storage<T, sizeof(T) * 4, detail::is_aligned<P>::value>::type data;
|
typename detail::storage<T, sizeof(T) * 4, detail::is_aligned<P>::value>::type data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic pop
|
||||||
|
# endif
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
# endif
|
||||||
# else
|
# else
|
||||||
T x, y, z, w;
|
T x, y, z, w;
|
||||||
# endif
|
# endif
|
||||||
|
Loading…
Reference in New Issue
Block a user