diff --git a/src/support/Path.cpp b/src/support/Path.cpp index 8b85471c97..fbf48d8d13 100644 --- a/src/support/Path.cpp +++ b/src/support/Path.cpp @@ -10,14 +10,12 @@ #include -// Needed to prevent the definition of the unnamed_PathChanger macro -// in the header file. - -#define PATHCHANGER_C - #include "support/Path.h" #include "support/lyxlib.h" +// undef PathChanger macro when building PathChanger +#undef PathChanger + namespace lyx { namespace support { @@ -63,3 +61,7 @@ int PathChanger::pop() } // namespace support } // namespace lyx + + +#define PathChanger(x) unnamed_PathChanger; +// in merged builds this is not the last line. diff --git a/src/support/Path.h b/src/support/Path.h index 4c3d6ba1e8..d61a47a0f3 100644 --- a/src/support/Path.h +++ b/src/support/Path.h @@ -56,9 +56,7 @@ private: // PathChanger("/tmp"); // wrong // PathChanger p("/tmp"); // right // we add this macro: -#ifndef PATHCHANGER_C #define PathChanger(x) unnamed_PathChanger; -#endif // Tip gotten from Bobby Schmidt's column in C/C++ Users Journal } // namespace support