Skip to content

Commit

Permalink
Clean up GLM_MESSAGES compilation log to report only detected capabil…
Browse files Browse the repository at this point in the history
…ities
  • Loading branch information
Christophe Riccio committed Dec 10, 2014
1 parent abcc460 commit 5331b67
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
36 changes: 21 additions & 15 deletions glm/detail/setup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
///////////////////////////////////////////////////////////////////////////////////
// C++ Version

// User defines: GLM_FORCE_CXX98
// User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX11, GLM_FORCE_CXX14

#define GLM_LANG_CXX98_FLAG (1 << 1)
#define GLM_LANG_CXX03_FLAG (1 << 2)
Expand Down Expand Up @@ -462,10 +462,13 @@

#if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_LANG_DISPLAYED)
# define GLM_MESSAGE_LANG_DISPLAYED
# if GLM_LANG & GLM_LANG_CXXGNU_FLAG
# pragma message("GLM: C++ with language extensions")
# elif GLM_LANG & GLM_LANG_CXXMS_FLAG
# pragma message("GLM: C++ with language extensions")

# if GLM_LANG & GLM_LANG_CXX1Z_FLAG
# pragma message("GLM: C++1z")
# elif GLM_LANG & GLM_LANG_CXX14_FLAG
# pragma message("GLM: C++14")
# elif GLM_LANG & GLM_LANG_CXX1Y_FLAG
# pragma message("GLM: C++1y")
# elif GLM_LANG & GLM_LANG_CXX11_FLAG
# pragma message("GLM: C++11")
# elif GLM_LANG & GLM_LANG_CXX0X_FLAG
Expand All @@ -476,8 +479,11 @@
# pragma message("GLM: C++98")
# else
# pragma message("GLM: C++ language undetected")
# endif//GLM_MODEL
# pragma message("GLM: #define GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_LANG_CXX11 or GLM_FORCE_CXX1Y to force using a specific version of the C++ language")
# endif//GLM_LANG

# if GLM_LANG & (GLM_LANG_CXXGNU_FLAG | GLM_LANG_CXXMS_FLAG)
# pragma message("GLM: Language extensions enabled")
# endif//GLM_LANG
#endif//GLM_MESSAGE

///////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -721,7 +727,6 @@
# elif(GLM_ARCH & GLM_ARCH_SSE2)
# pragma message("GLM: SSE2 instruction set")
# endif//GLM_ARCH
# pragma message("GLM: #define GLM_FORCE_PURE to avoid using platform specific instruction sets")
#endif//GLM_MESSAGE

///////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -831,11 +836,11 @@
namespace glm
{
using std::size_t;
#if defined(GLM_FORCE_SIZE_T_LENGTH) || defined(GLM_FORCE_SIZE_FUNC)
typedef size_t length_t;
#else
typedef int length_t;
#endif
# if defined(GLM_FORCE_SIZE_T_LENGTH) || defined(GLM_FORCE_SIZE_FUNC)
typedef size_t length_t;
# else
typedef int length_t;
# endif

namespace detail
{
Expand All @@ -859,11 +864,12 @@ namespace detail

#if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_FORCE_SIZE_T_LENGTH)
# define GLM_MESSAGE_FORCE_SIZE_T_LENGTH
# if defined(GLM_FORCE_SIZE_T_LENGTH)
# if defined GLM_FORCE_SIZE_FUNC
# pragma message("GLM: .length() is replaced by .size() and returns a std::size_t")
# elif defined GLM_FORCE_SIZE_T_LENGTH
# pragma message("GLM: .length() returns glm::length_t, a typedef of std::size_t")
# else
# pragma message("GLM: .length() returns glm::length_t, a typedef of int following the GLSL specification")
# pragma message("GLM: #define GLM_FORCE_SIZE_T_LENGTH for .length() to return a size_t")
# endif
#endif//GLM_MESSAGE

Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ Features:
- Added GLM_LANG_CXX14_FLAG and GLM_LANG_CXX1Z_FLAG language feature flags
- Added C++14 detection

Improvements:
- Clean up GLM_MESSAGES compilation log to report only detected capabilities

Fixes:
- Fixed scalar uaddCarry build error with Cuda #276
- Fixed C++11 explicit conversion operators detection #282
Expand All @@ -77,6 +80,7 @@ Fixes:
- Fixed Android build issue, STL C++11 is not supported by the NDK #284
- Fixed unsupported _BitScanForward64 and _BitScanReverse64 in VC10
- Fixed Visual C++ 32 bit build #283
- Fixed GLM_FORCE_SIZE_FUNC pragma message

================================================================================
GLM 0.9.6.0: 2014-11-30
Expand Down
1 change: 0 additions & 1 deletion test/core/core_setup_force_cxx98.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////

#define GLM_FORCE_PURE
#define GLM_FORCE_CXX98
#include <glm/glm.hpp>
#include <glm/ext.hpp>
Expand Down

0 comments on commit 5331b67

Please sign in to comment.