diff --git a/project/vc12/nvcore/nvcore.vcxproj b/project/vc12/nvcore/nvcore.vcxproj index 00835fd..733f6a9 100644 --- a/project/vc12/nvcore/nvcore.vcxproj +++ b/project/vc12/nvcore/nvcore.vcxproj @@ -157,6 +157,7 @@ + diff --git a/src/nvcore/ForEach.h b/src/nvcore/ForEach.h index bf30e2f..078227f 100644 --- a/src/nvcore/ForEach.h +++ b/src/nvcore/ForEach.h @@ -10,21 +10,27 @@ These foreach macros are very non-standard and somewhat confusing, but I like th #include "nvcore.h" -#if NV_CC_GNUC || NV_CC_CPP11 // If typeof or decltype is available: +#if NV_CC_GNUC // If typeof or decltype is available: #if !NV_CC_CPP11 # define NV_DECLTYPE typeof // Using a non-standard extension over typeof that behaves as C++11 decltype #else # define NV_DECLTYPE decltype #endif -#define NV_FOREACH(i, container) \ - typedef NV_DECLTYPE(container) NV_STRING_JOIN2(cont,__LINE__); \ - for(NV_STRING_JOIN2(cont,__LINE__)::PseudoIndex i((container).start()); !(container).isDone(i); (container).advance(i)) /* +Ideally we would like to write this: + #define NV_FOREACH(i, container) \ -for(typename typeof(container)::PseudoIndex i((container).start()); !(container).isDone(i); (container).advance(i)) + for(NV_DECLTYPE(container)::PseudoIndex i((container).start()); !(container).isDone(i); (container).advance(i)) + +But gcc versions prior to 4.7 required an intermediate type. See: +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=6709 */ +#define NV_FOREACH(i, container) \ + typedef NV_DECLTYPE(container) NV_STRING_JOIN2(cont,__LINE__); \ + for(NV_STRING_JOIN2(cont,__LINE__)::PseudoIndex i((container).start()); !(container).isDone(i); (container).advance(i)) + #else // If typeof not available: #include // placement new diff --git a/src/nvtt/tools/decompress.cpp b/src/nvtt/tools/decompress.cpp index 21a70b4..a5d592f 100644 --- a/src/nvtt/tools/decompress.cpp +++ b/src/nvtt/tools/decompress.cpp @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) bool faces = false; bool savePNG = false; bool rgbm = false; - bool histogram = true; + bool histogram = false; nv::Path input; nv::Path output;