summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-07-26 15:34:57 (GMT)
committerBrad King <brad.king@kitware.com>2005-07-26 15:34:57 (GMT)
commitb9d472d81dd5c2e12583aa0a8447e9eaa2d8ed50 (patch)
tree0c4b626230e4417cafd69c123c68a03bb31ff0c6
parent5b26fefd60eb9ca6b1ee351fe4e17e12eb0ec19d (diff)
downloadCMake-b9d472d81dd5c2e12583aa0a8447e9eaa2d8ed50.zip
CMake-b9d472d81dd5c2e12583aa0a8447e9eaa2d8ed50.tar.gz
CMake-b9d472d81dd5c2e12583aa0a8447e9eaa2d8ed50.tar.bz2
ENH: Moved kwsys_ns and kwsysEXPORT macros to Configure.h in the case of building a kwsys source file. This allows more than one header to be included in a kwsys source file without redefining the macros.
-rw-r--r--Source/kwsys/Base64.c1
-rw-r--r--Source/kwsys/Base64.h.in12
-rw-r--r--Source/kwsys/Configure.h.in8
-rw-r--r--Source/kwsys/Process.h.in6
4 files changed, 19 insertions, 8 deletions
diff --git a/Source/kwsys/Base64.c b/Source/kwsys/Base64.c
index 1111a51..ce3cf97 100644
--- a/Source/kwsys/Base64.c
+++ b/Source/kwsys/Base64.c
@@ -11,7 +11,6 @@
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
-#define KWSYS_IN_BASE64_C
#include "kwsysPrivate.h"
#include KWSYS_HEADER(Base64.h)
diff --git a/Source/kwsys/Base64.h.in b/Source/kwsys/Base64.h.in
index 14bb1ec..45221f6 100644
--- a/Source/kwsys/Base64.h.in
+++ b/Source/kwsys/Base64.h.in
@@ -20,8 +20,10 @@
namespace. These macros are used internally to kwsys only, and are
not visible to user code. Use kwsysHeaderDump.pl to reproduce
these macros after making changes to the interface. */
-#define kwsys_ns(x) @KWSYS_NAMESPACE@##x
-#define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
+#if !defined(KWSYS_NAMESPACE)
+# define kwsys_ns(x) @KWSYS_NAMESPACE@##x
+# define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
+#endif
#define kwsysBase64 kwsys_ns(Base64)
#define kwsysBase64_Decode kwsys_ns(Base64_Decode)
#define kwsysBase64_Decode3 kwsys_ns(Base64_Decode3)
@@ -99,9 +101,9 @@ kwsysEXPORT unsigned long kwsysBase64_Decode(const unsigned char *input,
} /* extern "C" */
#endif
-/* If we are building Base64.c, let it use these macros. Otherwise,
- undefine them to keep the namespace clean. */
-#if !defined(KWSYS_IN_BASE64_C)
+/* If we are building a kwsys .c or .cxx file, let it use these macros.
+ Otherwise, undefine them to keep the namespace clean. */
+#if !defined(KWSYS_NAMESPACE)
# undef kwsys_ns
# undef kwsysEXPORT
# undef kwsysBase64
diff --git a/Source/kwsys/Configure.h.in b/Source/kwsys/Configure.h.in
index 4783b56..744e884 100644
--- a/Source/kwsys/Configure.h.in
+++ b/Source/kwsys/Configure.h.in
@@ -14,6 +14,14 @@
#ifndef @KWSYS_NAMESPACE@_Configure_h
#define @KWSYS_NAMESPACE@_Configure_h
+/* If we are building a kwsys .c or .cxx file, let it use the kwsys
+ namespace. When not building a kwsys source file these macros are
+ temporarily defined inside the headers that use them. */
+#if defined(KWSYS_NAMESPACE)
+# define kwsys_ns(x) @KWSYS_NAMESPACE@##x
+# define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
+#endif
+
/* Setup the export macro. */
#if defined(_WIN32) && @KWSYS_BUILD_SHARED@
# if defined(@KWSYS_NAMESPACE@_EXPORTS)
diff --git a/Source/kwsys/Process.h.in b/Source/kwsys/Process.h.in
index 26779d7..96d3225 100644
--- a/Source/kwsys/Process.h.in
+++ b/Source/kwsys/Process.h.in
@@ -20,8 +20,10 @@
namespace. These macros are used internally to kwsys only, and are
not visible to user code. Use kwsysHeaderDump.pl to reproduce
these macros after making changes to the interface. */
-#define kwsys_ns(x) @KWSYS_NAMESPACE@##x
-#define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
+#if !defined(KWSYS_NAMESPACE)
+# define kwsys_ns(x) @KWSYS_NAMESPACE@##x
+# define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
+#endif
#define kwsysProcess kwsys_ns(Process)
#define kwsysProcess_s kwsys_ns(Process_s)
#define kwsysProcess_New kwsys_ns(Process_New)