Updated logging to include the class/method so that it is more obvious where these...
[ACE_TAO.git] / TAO / tao / Versioned_Namespace.h
blob142e88c9f86b10d0af8b8471b8249506bd623599
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Versioned_Namespace.h
7 * Versioned namespace support.
9 * Useful for preventing conflicts when using a third party library.
11 * @author Ossama Othman <ossama@dre.vanderbilt.edu>
13 //=============================================================================
15 #ifndef TAO_VERSIONED_NAMESPACE_H
16 #define TAO_VERSIONED_NAMESPACE_H
18 #if !defined (TAO_ORBCONF_H) && !defined (ACE_CONFIG_MACROS_H)
19 # error This header is only meant to be included after "tao/orbconf.h".
20 #endif /* !TAO_ORBCONF_H */
23 #if !defined (TAO_HAS_VERSIONED_NAMESPACE) \
24 && defined (ACE_HAS_VERSIONED_NAMESPACE) \
25 && ACE_HAS_VERSIONED_NAMESPACE == 1
26 # define TAO_HAS_VERSIONED_NAMESPACE 1
27 #endif /* !TAO_HAS_VERSIONED_NAMESPACE
28 && ACE_HAS_VERSIONED_NAMESPACE == 1*/
30 #if defined (TAO_HAS_VERSIONED_NAMESPACE) && TAO_HAS_VERSIONED_NAMESPACE == 1
32 # ifndef TAO_VERSIONED_NAMESPACE_NAME
33 # include "tao/Version.h"
35 // Preprocessor symbols will not be expanded if they are
36 // concatenated. Force the preprocessor to expand them during the
37 // argument prescan by calling a macro that itself calls another that
38 // performs the actual concatenation.
39 # define TAO_MAKE_VERSIONED_NAMESPACE_NAME_IMPL(MAJOR,MINOR,MICRO) TAO_ ## MAJOR ## _ ## MINOR ## _ ## MICRO
40 # define TAO_MAKE_VERSIONED_NAMESPACE_NAME(MAJOR,MINOR,MICRO) TAO_MAKE_VERSIONED_NAMESPACE_NAME_IMPL(MAJOR,MINOR,MICRO)
41 # define TAO_VERSIONED_NAMESPACE_NAME TAO_MAKE_VERSIONED_NAMESPACE_NAME(TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_MICRO_VERSION)
42 # endif /* !TAO_VERSIONED_NAMESPACE_NAME */
44 # define TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace TAO_VERSIONED_NAMESPACE_NAME {
45 # define TAO_END_VERSIONED_NAMESPACE_DECL } \
46 using namespace TAO_VERSIONED_NAMESPACE_NAME;
48 #else
50 # define TAO_VERSIONED_NAMESPACE_NAME
51 # define TAO_BEGIN_VERSIONED_NAMESPACE_DECL
52 # define TAO_END_VERSIONED_NAMESPACE_DECL
54 #endif /* TAO_HAS_VERSIONED_NAMESPACE */
56 #endif /* !TAO_VERSIONED_NAMESPACE_H */