- Added error for including of different versions of GLM #619 - Added GLM_FORCE_IGNORE_VERSION to ignore error caused by including different version of GLM #619

This commit is contained in:
Christophe Riccio 2017-06-04 11:36:13 +02:00
parent 83602bdea4
commit a9a832e187
32 changed files with 87 additions and 21 deletions

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/common.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/func_common.hpp"

View File

@ -20,7 +20,7 @@ namespace detail
}
# endif
template<length_t L, typename T, precision P, template<int, class, precision> class vecType, bool isFloat, bool Aligned>
template<length_t L, typename T, precision P, template<length_t, class, precision> class vecType, bool isFloat, bool Aligned>
struct compute_log2
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& v)

View File

@ -111,7 +111,7 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template<int DA, int DB, typename T, precision P, template<length_t, typename, precision> class vecTypeA, template<length_t, typename, precision> class vecTypeB>
template<length_t DA, length_t DB, typename T, precision P, template<length_t, typename, precision> class vecTypeA, template<length_t, typename, precision> class vecTypeB>
GLM_FUNC_DECL typename detail::outerProduct_trait<DA, DB, T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<DA, T, P> const & c, vecTypeB<DB, T, P> const & r);
/// Returns the transposed matrix of x

View File

@ -362,7 +362,7 @@ namespace detail
return detail::compute_matrixCompMult<matType, C, R, T, P, detail::is_aligned<P>::value>::call(x, y);
}
template<int DA, int DB, typename T, precision P, template<length_t, typename, precision> class vecTypeA, template<length_t, typename, precision> class vecTypeB>
template<length_t DA, length_t DB, typename T, precision P, template<length_t, typename, precision> class vecTypeA, template<length_t, typename, precision> class vecTypeB>
GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<DA, DB, T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<DA, T, P> const & c, vecTypeB<DB, T, P> const & r)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs");

View File

@ -1,12 +1,23 @@
/// @ref core
/// @file glm/detail/setup.hpp
#pragma once
#ifndef GLM_SETUP_INCLUDED
#define GLM_VERSION_MAJOR 0
#define GLM_VERSION_MINOR 9
#define GLM_VERSION_PATCH 9
#define GLM_VERSION_REVISION 0
#define GLM_VERSION 990
#define GLM_SETUP_INCLUDED GLM_VERSION
#if defined(GLM_FORCE_SWIZZLE) && defined(GLM_FORCE_UNRESTRICTED_GENTYPE)
# error "Both GLM_FORCE_SWIZZLE and GLM_FORCE_UNRESTRICTED_GENTYPE can't be defined at the same time"
#endif
#include <cassert>
#include <cstddef>
///////////////////////////////////////////////////////////////////////////////////
// Messages
@ -19,19 +30,14 @@
# define GLM_MESSAGES GLM_MESSAGES_DISABLE
#endif
#include <cassert>
#include <cstddef>
///////////////////////////////////////////////////////////////////////////////////
// Detect the platform
#include "../simd/platform.h"
///////////////////////////////////////////////////////////////////////////////////
// Version
#define GLM_VERSION 99
#define GLM_VERSION_MAJOR 0
#define GLM_VERSION_MINOR 9
#define GLM_VERSION_PATCH 9
#define GLM_VERSION_REVISION 0
#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_VERSION_DISPLAYED)
# define GLM_MESSAGE_VERSION_DISPLAYED
# pragma message ("GLM: version 0.9.9.0")
@ -731,9 +737,11 @@
#define GLM_HAS_ALIGNED_TYPE GLM_HAS_UNRESTRICTED_UNIONS
///////////////////////////////////////////////////////////////////////////////////
// Length type
// Length type: all length functions returns a length_t type.
// When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise
// length_t is a typedef of int like GLSL defines it.
// User defines: GLM_FORCE_SIZE_T_LENGTH GLM_FORCE_SIZE_FUNC
// User define: GLM_FORCE_SIZE_T_LENGTH
namespace glm
{
@ -784,3 +792,12 @@ namespace glm
{
enum ctor{uninitialize};
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
// 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
#endif//GLM_SETUP_INCLUDED

View File

@ -8,7 +8,7 @@
namespace glm{
namespace detail
{
template<int Columns, int Rows, typename T, precision P, template<int, class, precision> class colType, template<int, class, precision> class rowType>
template<length_t Columns, length_t Rows, typename T, precision P, template<length_t, class, precision> class colType, template<length_t, class, precision> class rowType>
struct outerProduct_trait{};
}//namespace detail

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/exponential.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/func_exponential.hpp"

View File

@ -25,6 +25,8 @@
/// at once by including <glm/ext.hpp>. Otherwise, each extension needs to be
/// included a specific file.
#include "detail/setup.hpp"
#pragma once
#include "glm.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/fwd.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_int.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/geometric.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/func_geometric.hpp"

View File

@ -51,6 +51,8 @@
#include "detail/_fixes.hpp"
#include "detail/setup.hpp"
#pragma once
#include <cmath>

View File

@ -11,10 +11,11 @@
///
/// <glm/gtc/bitfield.hpp> need to be included to use these functionalities.
#include "../detail/setup.hpp"
#pragma once
// Dependencies
#include "../detail/setup.hpp"
#include "../detail/precision.hpp"
#include "../detail/type_int.hpp"
#include "../detail/_vectorize.hpp"

View File

@ -32,10 +32,10 @@ namespace glm
/// @param Max
/// @tparam genType Value type. Currently supported: float or double scalars.
/// @see gtc_random
template<typename genTYpe>
GLM_FUNC_DECL genTYpe linearRand(
genTYpe Min,
genTYpe Max);
template<typename genType>
GLM_FUNC_DECL genType linearRand(
genType Min,
genType Max);
/// Generate random numbers in the interval [Min, Max], according a linear distribution
///

View File

@ -10,7 +10,7 @@
namespace glm{
namespace detail
{
template<length_t L, typename T, precision P, template<int, class, precision> class vecType>
template<length_t L, typename T, precision P, template<length_t, class, precision> class vecType>
struct compute_rand
{
GLM_FUNC_QUALIFIER static vecType<L, T, P> call();

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/integer.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/func_integer.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/mat2x2.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_mat2x2.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/mat2x3.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_mat2x3.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/mat2x4.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_mat2x4.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/mat3x2.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_mat3x2.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/mat3x3.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_mat3x3.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/mat3x4.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_mat3x4.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/mat4x2.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_mat4x2.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/mat4x3.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_mat4x3.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/mat4x4.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_mat4x4.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/matrix.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/func_matrix.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/packing.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/func_packing.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/trigonometric.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/func_trigonometric.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/vec2.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_vec2.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/vec3.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_vec3.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/vec4.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/type_vec4.hpp"

View File

@ -1,6 +1,8 @@
/// @ref core
/// @file glm/vector_relational.hpp
#include "detail/setup.hpp"
#pragma once
#include "detail/func_vector_relational.hpp"

View File

@ -69,6 +69,8 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
- Optimized GTX_matrix_interpolation axisAngle function
- Added FAQ 12: Windows headers cause build errors... #557
- Removed GCC shadow warnings #595
- Added error for including of different versions of GLM #619
- Added GLM_FORCE_IGNORE_VERSION to ignore error caused by including different version of GLM #619
#### Fixes:
- Removed doxygen references to GTC_half_float which was removed in 0.9.4