From 732b40c251eafbd034abeebe7731c818e5591193 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 5 Dec 2014 18:09:48 +0100 Subject: [PATCH 01/12] Fixed 64 bits integer GTX_string_cast to_string on VC 32 bit compiler --- glm/gtx/string_cast.inl | 74 ++++++++++++++++++++++++++++------------- readme.txt | 1 + 2 files changed, 51 insertions(+), 24 deletions(-) diff --git a/glm/gtx/string_cast.inl b/glm/gtx/string_cast.inl index a898b542..24d1b3b4 100644 --- a/glm/gtx/string_cast.inl +++ b/glm/gtx/string_cast.inl @@ -59,73 +59,99 @@ namespace detail static const char* True = "true"; static const char* False = "false"; + template + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%d";}; + }; + + template + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%f";}; + }; + +# if GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC + template <> + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%lld";}; + }; + + template <> + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%lld";}; + }; +# endif//GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC + template struct prefix{}; template <> struct prefix { - static char const * value() {return "";}; + GLM_FUNC_QUALIFIER static char const * value() {return "";}; }; template <> struct prefix { - static char const * value() {return "d";}; + GLM_FUNC_QUALIFIER static char const * value() {return "d";}; }; template <> struct prefix { - static char const * value() {return "b";}; + GLM_FUNC_QUALIFIER static char const * value() {return "b";}; }; template <> struct prefix { - static char const * value() {return "u8";}; + GLM_FUNC_QUALIFIER static char const * value() {return "u8";}; }; template <> struct prefix { - static char const * value() {return "i8";}; + GLM_FUNC_QUALIFIER static char const * value() {return "i8";}; }; template <> struct prefix { - static char const * value() {return "u16";}; + GLM_FUNC_QUALIFIER static char const * value() {return "u16";}; }; template <> struct prefix { - static char const * value() {return "i16";}; + GLM_FUNC_QUALIFIER static char const * value() {return "i16";}; }; template <> struct prefix { - static char const * value() {return "u";}; + GLM_FUNC_QUALIFIER static char const * value() {return "u";}; }; template <> struct prefix { - static char const * value() {return "i";}; + GLM_FUNC_QUALIFIER static char const * value() {return "i";}; }; template <> struct prefix { - static char const * value() {return "u64";}; + GLM_FUNC_QUALIFIER static char const * value() {return "u64";}; }; template <> struct prefix { - static char const * value() {return "i64";}; + GLM_FUNC_QUALIFIER static char const * value() {return "i64";}; }; template