Fixed packDouble2x32 on XCode 4.5, issue #37

This commit is contained in:
Christophe Riccio 2013-01-23 01:49:42 +01:00
parent a33a2b2c42
commit 37e380ca9b
2 changed files with 33 additions and 2 deletions

View File

@ -136,12 +136,42 @@ namespace glm
GLM_FUNC_QUALIFIER double packDouble2x32(detail::tvec2<detail::uint32> const & v)
{
return *(double*)&v;
struct uint32_pair
{
detail::uint32 x;
detail::uint32 y;
};
union helper
{
uint32_pair input;
double output;
} Helper;
Helper.input.x = v.x;
Helper.input.y = v.y;
return Helper.output;
//return *(double*)&v;
}
GLM_FUNC_QUALIFIER detail::tvec2<uint> unpackDouble2x32(double const & v)
{
return *(detail::tvec2<uint>*)&v;
struct uint32_pair
{
detail::uint32 x;
detail::uint32 y;
};
union helper
{
double input;
uint32_pair output;
} Helper;
Helper.input = v;
return detail::tvec2<uint>(Helper.output.x, Helper.output.y);
}
GLM_FUNC_QUALIFIER uint packHalf2x16(detail::tvec2<float> const & v)

View File

@ -44,6 +44,7 @@ GLM 0.9.4.2: 2013-01-XX
- Fixed isnan and isinf for CUDA compiler
- Fixed GLM_FORCE_RADIANS on glm::perspective
- Fixed GCC warnings
- Fixed packDouble2x32 on XCode
================================================================================
GLM 0.9.4.1: 2012-12-22