From e830ee1be9aeca877a9c2aa9b6b104b72b2d6e79 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 16 Aug 2011 20:49:02 -0400 Subject: [PATCH] switched the Float keyword from a define to a typedef --- include/mitsuba/core/constants.h | 5 ----- include/mitsuba/mitsuba.h | 8 ++++++++ src/shapes/ply/ply.cpp | 9 --------- src/shapes/ply/ply/ply_parser.hpp | 9 --------- 4 files changed, 8 insertions(+), 23 deletions(-) diff --git a/include/mitsuba/core/constants.h b/include/mitsuba/core/constants.h index 9a179954..26e8ab04 100644 --- a/include/mitsuba/core/constants.h +++ b/include/mitsuba/core/constants.h @@ -21,13 +21,8 @@ /* Choice of precision */ #ifdef DOUBLE_PRECISION -#define Float double #define Epsilon 1e-6 #else -#ifndef SINGLE_PRECISION -#define SINGLE_PRECISION -#endif -#define Float float #define Epsilon 1e-4f #endif diff --git a/include/mitsuba/mitsuba.h b/include/mitsuba/mitsuba.h index cd062bce..cfbbc4f9 100644 --- a/include/mitsuba/mitsuba.h +++ b/include/mitsuba/mitsuba.h @@ -38,6 +38,14 @@ using std::cout; using std::cerr; using std::endl; +#if defined(DOUBLE_PRECISION) +typedef double Float; +#elif defined(SINGLE_PRECISION) +typedef float Float; +#else +#error No precision flag was defined! +#endif + /** * Include a basic subset of the core classes */ diff --git a/src/shapes/ply/ply.cpp b/src/shapes/ply/ply.cpp index 932338f0..9b630c4b 100644 --- a/src/shapes/ply/ply.cpp +++ b/src/shapes/ply/ply.cpp @@ -24,16 +24,7 @@ #include #if MTS_USE_BOOST_TR1 -# if defined(Float) -# define MTS_Float -# pragma push_macro("Float") -# undef Float -# endif #include -# if defined(MTS_Float) -# pragma pop_macro("Float") -# undef MTS_Float -# endif #else #if defined(_MSC_VER) && (_MSC_VER >= 1600) #include diff --git a/src/shapes/ply/ply/ply_parser.hpp b/src/shapes/ply/ply/ply_parser.hpp index c065e89f..30447273 100644 --- a/src/shapes/ply/ply/ply_parser.hpp +++ b/src/shapes/ply/ply/ply_parser.hpp @@ -30,18 +30,9 @@ #endif #if MTS_USE_BOOST_TR1 -# if defined(Float) -# define MTS_Float -# pragma push_macro("Float") -# undef Float -# endif #include #include #include -# if defined(MTS_Float) -# pragma pop_macro("Float") -# undef MTS_Float -# endif #else #if defined(_MSC_VER) && (_MSC_VER >= 1600) #include