diff --git a/code/AssetLib/Blender/BlenderTessellator.cpp b/code/AssetLib/Blender/BlenderTessellator.cpp index 3c1cd6ea8..3366d56c5 100644 --- a/code/AssetLib/Blender/BlenderTessellator.cpp +++ b/code/AssetLib/Blender/BlenderTessellator.cpp @@ -386,7 +386,14 @@ void BlenderTessellatorP2T::ReferencePoints( std::vector< Blender::PointP2T >& p // ------------------------------------------------------------------------------------------------ inline PointP2T& BlenderTessellatorP2T::GetActualPointStructure( p2t::Point& point ) const { +#if defined __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Winvalid-offsetof" +#endif // __clang__ unsigned int pointOffset = offsetof( PointP2T, point2D ); +#if defined __clang__ +# pragma clang diagnostic pop +#endif PointP2T& pointStruct = *reinterpret_cast< PointP2T* >( reinterpret_cast< char* >( &point ) - pointOffset ); if ( pointStruct.magic != static_cast( BLEND_TESS_MAGIC ) ) { @@ -394,7 +401,6 @@ inline PointP2T& BlenderTessellatorP2T::GetActualPointStructure( p2t::Point& poi } return pointStruct; } - // ------------------------------------------------------------------------------------------------ void BlenderTessellatorP2T::MakeFacesFromTriangles( std::vector< p2t::Triangle* >& triangles ) const { diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 2ba893281..23cfba4ff 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -1065,7 +1065,7 @@ endif() ADD_DEFINITIONS( -DASSIMP_BUILD_DLL_EXPORT ) -if ( MSVC ) +IF( MSVC OR "${CMAKE_CXX_SIMULATE_ID}" MATCHES "MSVC") # clang with MSVC ABI ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) endif ()