diff --git a/include/internal/catch_clara.h b/include/internal/catch_clara.h index 636be471..0f9dfa62 100644 --- a/include/internal/catch_clara.h +++ b/include/internal/catch_clara.h @@ -9,8 +9,8 @@ #ifndef TWOBLUECUBES_CATCH_CLARA_H_INCLUDED #define TWOBLUECUBES_CATCH_CLARA_H_INCLUDED -#define CLICHE_CLARA_EMBEDDED_NAMESPACE Catch +#define CLICHE_CLARA_OUTER_NAMESPACE Catch #include "clara.h" -#undef CLICHE_CLARA_EMBEDDED_NAMESPACE +#undef CLICHE_CLARA_OUTER_NAMESPACE #endif // TWOBLUECUBES_CATCH_CLARA_H_INCLUDED diff --git a/include/internal/clara.h b/include/internal/clara.h index 494b959a..7ae8c334 100644 --- a/include/internal/clara.h +++ b/include/internal/clara.h @@ -5,20 +5,24 @@ * Distributed under the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef CLICHE_CLARA_EMBEDDED_NAMESPACE -#ifdef TWOBLUECUBES_CLARA_H_INCLUDED -#define TWOBLUECUBES_CLARA_H_ALREADY_INCLUDED -#else -#define TWOBLUECUBES_CLARA_H_INCLUDED -#endif -#endif +// Only use header guard if we are not using an outer namespace +#ifndef CLICHE_CLARA_OUTER_NAMESPACE +# ifdef TWOBLUECUBES_CLARA_H_INCLUDED +# ifndef TWOBLUECUBES_CLARA_H_ALREADY_INCLUDED +# define TWOBLUECUBES_CLARA_H_ALREADY_INCLUDED +# endif +# else +# define TWOBLUECUBES_CLARA_H_INCLUDED +# endif +#endif #ifndef TWOBLUECUBES_CLARA_H_ALREADY_INCLUDED #include "catch_text.h" // This will get moved out too -#ifdef CLICHE_CLARA_EMBEDDED_NAMESPACE -namespace CLICHE_CLARA_EMBEDDED_NAMESPACE { +// Use optional outer namespace +#ifdef CLICHE_CLARA_OUTER_NAMESPACE +namespace CLICHE_CLARA_OUTER_NAMESPACE { #endif namespace Clara { @@ -593,7 +597,7 @@ namespace Clara { } // end namespace Clara -#ifdef CLICHE_CLARA_EMBEDDED_NAMESPACE +#ifdef CLICHE_CLARA_OUTER_NAMESPACE } // end embedded namespace #endif diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp index 3eb54d2f..8d003fed 100644 --- a/projects/SelfTest/CmdLineTests.cpp +++ b/projects/SelfTest/CmdLineTests.cpp @@ -9,7 +9,7 @@ #pragma clang diagnostic ignored "-Wpadded" #endif -#include "internal/clara.h" +#include "internal/clara.h" // This will does not declare Clara within the Catch namespace #include "catch.hpp"