diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index 3a232997..dac1004e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -153,8 +153,18 @@ namespace PolyVox class LargeVolume : public Volume { public: - typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. See http://goo.gl/qu1wn - class Sampler : public VolumeOfVoxelType::template Sampler< LargeVolume > + //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. + //There is a work around (see also See http://goo.gl/qu1wn) given below which appears to work on VS2010 and GCC, but + //which seems to cause internal compiler errors on VS2008 when building with the /Gm 'Enable Minimal Rebuild' compiler + //option. For now it seems best to 'fix' it with the preprocessor insstead, but maybe the workaround can be reinstated + //in the future + //typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. + //class Sampler : public VolumeOfVoxelType::template Sampler< LargeVolume > +#if defined(_MSC_VER) + class Sampler : public Volume::Sampler< LargeVolume > //This line works on VS2010 +#else + class Sampler : public Volume::Sampler Nested< LargeVolume > //This line works on GCC +#endif { public: Sampler(LargeVolume* volume); diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h index fb73f6ea..de56e31e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h @@ -42,8 +42,18 @@ namespace PolyVox { public: #ifndef SWIG - typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. See http://goo.gl/qu1wn - class Sampler : public VolumeOfVoxelType::template Sampler< RawVolume > + //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. + //There is a work around (see also See http://goo.gl/qu1wn) given below which appears to work on VS2010 and GCC, but + //which seems to cause internal compiler errors on VS2008 when building with the /Gm 'Enable Minimal Rebuild' compiler + //option. For now it seems best to 'fix' it with the preprocessor insstead, but maybe the workaround can be reinstated + //in the future + //typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. + //class Sampler : public VolumeOfVoxelType::template Sampler< RawVolume > +#if defined(_MSC_VER) + class Sampler : public Volume::Sampler< RawVolume > //This line works on VS2010 +#else + class Sampler : public Volume::Sampler Nested< RawVolume > //This line works on GCC +#endif { public: Sampler(RawVolume* volume); diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h index b9af204e..58efadc6 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h @@ -67,8 +67,18 @@ namespace PolyVox uint8_t m_uSideLengthPower; }; - typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. See http://goo.gl/qu1wn - class Sampler : public VolumeOfVoxelType::template Sampler< SimpleVolume > + //There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared. + //There is a work around (see also See http://goo.gl/qu1wn) given below which appears to work on VS2010 and GCC, but + //which seems to cause internal compiler errors on VS2008 when building with the /Gm 'Enable Minimal Rebuild' compiler + //option. For now it seems best to 'fix' it with the preprocessor insstead, but maybe the workaround can be reinstated + //in the future + //typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. + //class Sampler : public VolumeOfVoxelType::template Sampler< SimpleVolume > +#if defined(_MSC_VER) + class Sampler : public Volume::Sampler< SimpleVolume > //This line works on VS2010 +#else + class Sampler : public Volume::Sampler Nested< SimpleVolume > //This line works on GCC +#endif { public: Sampler(SimpleVolume* volume);