Create polyvox_constexpr macros based on the detected features

We now have a two new polyvox_ macros:

* polyvox_constexpr which is 'constexpr' is supported and '' otherwise
* polyvox_constexpr_const constexpr which is also 'constexpr' is supported
  but falls back to 'const' otherwise.

These macros should be safe to use liberally without worrying about which
compiler you're on.
This commit is contained in:
Matt Williams 2012-11-23 11:51:55 +00:00
parent 3902e00a0f
commit c8657943c8

View File

@ -104,4 +104,12 @@ freely, subject to the following restrictions:
//#define static_assert static_assert //we can use this
#endif
#if defined(HAS_CXX11_CONSTEXPR)
#define polyvox_constexpr_const constexpr //constexpr which falls back to const
#define polyvox_constexpr constexpr //constexpr which falls back to nothing
#else
#define polyvox_constexpr_const const
#define polyvox_constexpr
#endif
#endif