From 8669e5e67476a1e6c6e6582e2fd46b1a29100b0c Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Thu, 16 Mar 2017 21:48:10 +0000 Subject: [PATCH] Fix wrong macro usage. This should work with both modern GCC and clang. --- cloonel_vectorwrapper/vector_cast.hpp.in | 7 ++----- cloonel_vectorwrapper/vectorops.hpp.in | 7 ++----- cloonel_vectorwrapper/vectorwrapper.hpp.in | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/cloonel_vectorwrapper/vector_cast.hpp.in b/cloonel_vectorwrapper/vector_cast.hpp.in index 7b90e67..e79df9c 100644 --- a/cloonel_vectorwrapper/vector_cast.hpp.in +++ b/cloonel_vectorwrapper/vector_cast.hpp.in @@ -21,8 +21,8 @@ //See vectorwrapper.hpp.in for comments +#pragma push_macro("VWR_OUTER_NAMESPACE") #if defined(VWR_OUTER_NAMESPACE) -# define OLD_VWR_OUTER_NAMESPACE VWR_OUTER_NAMESPACE # undef VWR_OUTER_NAMESPACE #endif @@ -30,7 +30,4 @@ #include "@CMAKE_CURRENT_SOURCE_DIR@/../../lib/vectorwrapper/include/vectorwrapper/vector_cast.hpp" #undef VWR_OUTER_NAMESPACE -#if defined(OLD_VWR_OUTER_NAMESPACE) -# define VWR_OUTER_NAMESPACE OLD_VWR_OUTER_NAMESPACE -# undef OLD_VWR_OUTER_NAMESPACE -#endif +#pragma pop_macro("VWR_OUTER_NAMESPACE") diff --git a/cloonel_vectorwrapper/vectorops.hpp.in b/cloonel_vectorwrapper/vectorops.hpp.in index 8f3776a..8fb0f0d 100644 --- a/cloonel_vectorwrapper/vectorops.hpp.in +++ b/cloonel_vectorwrapper/vectorops.hpp.in @@ -21,8 +21,8 @@ //See vectorwrapper.hpp.in for comments +#pragma push_macro("VWR_OUTER_NAMESPACE") #if defined(VWR_OUTER_NAMESPACE) -# define OLD_VWR_OUTER_NAMESPACE VWR_OUTER_NAMESPACE # undef VWR_OUTER_NAMESPACE #endif @@ -30,7 +30,4 @@ #include "@CMAKE_CURRENT_SOURCE_DIR@/../../lib/vectorwrapper/include/vectorwrapper/vectorops.hpp" #undef VWR_OUTER_NAMESPACE -#if defined(OLD_VWR_OUTER_NAMESPACE) -# define VWR_OUTER_NAMESPACE OLD_VWR_OUTER_NAMESPACE -# undef OLD_VWR_OUTER_NAMESPACE -#endif +#pragma pop_macro("VWR_OUTER_NAMESPACE") diff --git a/cloonel_vectorwrapper/vectorwrapper.hpp.in b/cloonel_vectorwrapper/vectorwrapper.hpp.in index 8eba04d..7f0c62a 100644 --- a/cloonel_vectorwrapper/vectorwrapper.hpp.in +++ b/cloonel_vectorwrapper/vectorwrapper.hpp.in @@ -30,8 +30,8 @@ //absolute path here and forcing the outer namespace to cloonel this problem //should be avoided. +#pragma push_macro("VWR_OUTER_NAMESPACE") #if defined(VWR_OUTER_NAMESPACE) -# define OLD_VWR_OUTER_NAMESPACE VWR_OUTER_NAMESPACE # undef VWR_OUTER_NAMESPACE #endif @@ -39,7 +39,4 @@ #include "@CMAKE_CURRENT_SOURCE_DIR@/../../lib/vectorwrapper/include/vectorwrapper/vectorwrapper.hpp" #undef VWR_OUTER_NAMESPACE -#if defined(OLD_VWR_OUTER_NAMESPACE) -# define VWR_OUTER_NAMESPACE OLD_VWR_OUTER_NAMESPACE -# undef OLD_VWR_OUTER_NAMESPACE -#endif +#pragma pop_macro("VWR_OUTER_NAMESPACE")