summaryrefslogtreecommitdiff
path: root/ACE/ace/Versioned_Namespace.h
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:30 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:30 +0000
commitc44379cc7d9c7aa113989237ab0f56db12aa5219 (patch)
tree66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/ace/Versioned_Namespace.h
parent3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff)
downloadATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz
Repo restructuring
Diffstat (limited to 'ACE/ace/Versioned_Namespace.h')
-rw-r--r--ACE/ace/Versioned_Namespace.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/ACE/ace/Versioned_Namespace.h b/ACE/ace/Versioned_Namespace.h
new file mode 100644
index 00000000000..542254876ff
--- /dev/null
+++ b/ACE/ace/Versioned_Namespace.h
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Versioned_Namespace.h
+ *
+ * $Id$
+ *
+ * Versioned namespace support.
+ *
+ * Useful for preventing conflicts when using a third party library.
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef ACE_VERSIONED_NAMESPACE_H
+#define ACE_VERSIONED_NAMESPACE_H
+
+#ifndef ACE_CONFIG_MACROS_H
+# error This header is only meant to be included by or after "ace/config-lite.h".
+#endif /* !ACE_CONFIG_LITE_H */
+
+
+#if defined (ACE_HAS_VERSIONED_NAMESPACE) && ACE_HAS_VERSIONED_NAMESPACE == 1
+
+# ifndef ACE_VERSIONED_NAMESPACE_NAME
+//# include "ace/Version.h"
+
+// Preprocessor symbols will not be expanded if they are
+// concatenated. Force the preprocessor to expand them during the
+// argument prescan by calling a macro that itself calls another that
+// performs the actual concatenation.
+# define ACE_MAKE_VERSIONED_NAMESPACE_NAME_IMPL(MAJOR,MINOR,BETA) ACE_ ## MAJOR ## _ ## MINOR ## _ ## BETA
+# define ACE_MAKE_VERSIONED_NAMESPACE_NAME(MAJOR,MINOR,BETA) ACE_MAKE_VERSIONED_NAMESPACE_NAME_IMPL(MAJOR,MINOR,BETA)
+# define ACE_VERSIONED_NAMESPACE_NAME ACE_MAKE_VERSIONED_NAMESPACE_NAME(ACE_MAJOR_VERSION,ACE_MINOR_VERSION,ACE_BETA_VERSION)
+# endif /* !ACE_VERSIONED_NAMESPACE_NAME */
+
+# define ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_VERSIONED_NAMESPACE_NAME {
+# define ACE_END_VERSIONED_NAMESPACE_DECL } \
+ using namespace ACE_VERSIONED_NAMESPACE_NAME;
+
+#else
+
+# define ACE_VERSIONED_NAMESPACE_NAME
+# define ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+# define ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* ACE_HAS_VERSIONED_NAMESPACE */
+
+#endif /* !ACE_VERSIONED_NAMESPACE_H */