From d8bcd09d9b0a875a0f26eaee56fa25c5c8951e0a Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 5 Mar 2014 16:47:51 +0100 Subject: [PATCH] Compile fixes for GCC. --- .../include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h | 6 ++++++ .../include/PolyVoxCore/MarchingCubesSurfaceExtractor.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h index ae605cd2..2162b450 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.h @@ -74,7 +74,13 @@ namespace PolyVox } template + // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template + // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? +#if defined(_MSC_VER) SurfaceMesh extractCubicSurfaceWithNormals(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType()) +#else + SurfaceMesh extractCubicSurfaceWithNormals(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) +#endif { DefaultIsQuadNeeded isQuadNeeded; return extractCubicSurfaceWithNormals >(volData, region, eWrapMode, tBorderValue, isQuadNeeded); diff --git a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h index 2603641a..513b02e0 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/MarchingCubesSurfaceExtractor.h @@ -221,7 +221,13 @@ namespace PolyVox } template< typename VolumeType> + // This is a bit ugly - it seems that the C++03 syntax is different from the C++11 syntax? See this thread: http://stackoverflow.com/questions/6076015/typename-outside-of-template + // Long term we should probably come back to this and if the #ifdef is still needed then maybe it should check for C++11 mode instead of MSVC? +#if defined(_MSC_VER) SurfaceMesh extractMarchingCubesSurface(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = VolumeType::VoxelType()) +#else + SurfaceMesh extractMarchingCubesSurface(VolumeType* volData, Region region, WrapMode eWrapMode = WrapModes::Border, typename VolumeType::VoxelType tBorderValue = typename VolumeType::VoxelType()) +#endif { DefaultMarchingCubesController controller; return extractMarchingCubesSurface(volData, region, eWrapMode, tBorderValue, controller);