Replaced template 'hack' with preprocessor 'fix' to allow compilation on both GCC and Visual Studio. The previous approach was causing problems on VS2008.
This commit is contained in:
parent
06cc2806dd
commit
b84147f650
@ -153,8 +153,18 @@ namespace PolyVox
|
|||||||
class LargeVolume : public Volume<VoxelType>
|
class LargeVolume : public Volume<VoxelType>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef Volume<VoxelType> VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. See http://goo.gl/qu1wn
|
//There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared.
|
||||||
class Sampler : public VolumeOfVoxelType::template Sampler< LargeVolume<VoxelType> >
|
//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<VoxelType> VolumeOfVoxelType; //Workaround for GCC/VS2010 differences.
|
||||||
|
//class Sampler : public VolumeOfVoxelType::template Sampler< LargeVolume<VoxelType> >
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
class Sampler : public Volume<VoxelType>::Sampler< LargeVolume<VoxelType> > //This line works on VS2010
|
||||||
|
#else
|
||||||
|
class Sampler : public Volume<VoxelType>::Sampler Nested< LargeVolume<VoxelType> > //This line works on GCC
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sampler(LargeVolume<VoxelType>* volume);
|
Sampler(LargeVolume<VoxelType>* volume);
|
||||||
|
@ -42,8 +42,18 @@ namespace PolyVox
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
typedef Volume<VoxelType> VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. See http://goo.gl/qu1wn
|
//There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared.
|
||||||
class Sampler : public VolumeOfVoxelType::template Sampler< RawVolume<VoxelType> >
|
//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<VoxelType> VolumeOfVoxelType; //Workaround for GCC/VS2010 differences.
|
||||||
|
//class Sampler : public VolumeOfVoxelType::template Sampler< RawVolume<VoxelType> >
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
class Sampler : public Volume<VoxelType>::Sampler< RawVolume<VoxelType> > //This line works on VS2010
|
||||||
|
#else
|
||||||
|
class Sampler : public Volume<VoxelType>::Sampler Nested< RawVolume<VoxelType> > //This line works on GCC
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sampler(RawVolume<VoxelType>* volume);
|
Sampler(RawVolume<VoxelType>* volume);
|
||||||
|
@ -67,8 +67,18 @@ namespace PolyVox
|
|||||||
uint8_t m_uSideLengthPower;
|
uint8_t m_uSideLengthPower;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef Volume<VoxelType> VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. See http://goo.gl/qu1wn
|
//There seems to be some descrepency between Visual Studio and GCC about how the following class should be declared.
|
||||||
class Sampler : public VolumeOfVoxelType::template Sampler< SimpleVolume<VoxelType> >
|
//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<VoxelType> VolumeOfVoxelType; //Workaround for GCC/VS2010 differences.
|
||||||
|
//class Sampler : public VolumeOfVoxelType::template Sampler< SimpleVolume<VoxelType> >
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
class Sampler : public Volume<VoxelType>::Sampler< SimpleVolume<VoxelType> > //This line works on VS2010
|
||||||
|
#else
|
||||||
|
class Sampler : public Volume<VoxelType>::Sampler Nested< SimpleVolume<VoxelType> > //This line works on GCC
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sampler(SimpleVolume<VoxelType>* volume);
|
Sampler(SimpleVolume<VoxelType>* volume);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user