diff --git a/tests/vector3d_pack.cpp b/tests/vector3d_pack.cpp index 2b35743d1..7ebfd8fcb 100644 --- a/tests/vector3d_pack.cpp +++ b/tests/vector3d_pack.cpp @@ -1,5 +1,15 @@ #include "vector3d_pack.h" +// looks like VS10 does not support std::vector with explicit alignment +// From stackoverflow (https://stackoverflow.com/questions/8456236/how-is-a-vectors-data-aligned): +// +// Visual C++ version 2010 will not work with an std::vector with classes whose alignment are specified. +// The reason is std::vector::resize. +// When compiling, next error appears: +// c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector(870): error C2719: +// '_Val': formal parameter with __declspec(align('8')) won't be aligned [C:\projects\flatbuffers\flattests.vcxproj] +#if !defined(_MSC_VER) || _MSC_VER >= 1700 + #include "native_type_test_generated.h" namespace flatbuffers { @@ -11,3 +21,5 @@ namespace flatbuffers { return Native::Vector3D(obj.x(), obj.y(), obj.z()); } } + +#endif