diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2021-07-20 00:15:00 -0500 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2021-07-20 01:07:58 -0500 |
commit | 8ece0e448f1905c36ce5aaad498c5565550c0021 (patch) | |
tree | c8c7be2a2e15fcdaf68c12fc7c7564da41fe33ab /TAO/tao | |
parent | f46f63fcc2c467b6684855da743db9f77e93c240 (diff) | |
download | ATCD-8ece0e448f1905c36ce5aaad498c5565550c0021.tar.gz |
Header File for TAO_IDL Supported IDL Features
Get information about what IDL features the IDL compiler has, similarly
to the "version" standard header in C++.
In C++ it can be used like this if you want to be compatible with older
versions of TAO:
```c++
#include "tao/orbconf.h"
#if defined TAO_HAS_IDL_FEATURES && TAO_HAS_IDL_FEATURES
// Use this macro if you are using something that's not the max possible
// version.
# define TAO_IDL_IDL_VERSION 0x50000
# include "tao/idl_features.h"
# define USE_FEATURE defined TAO_IDL_HAS_FEATURE && TAO_IDL_HAS_FEATURE
#else
# define USE_FEATURE 0
#endif
```
In IDL it can be used like this if you want to be compatible with older
versions of TAO:
```c++
#if defined __TAO_IDL_FEATURES
# include __TAO_IDL_FEATURES
# define USE_FEATURE defined TAO_IDL_HAS_FEATURE && TAO_IDL_HAS_FEATURE
#else
# define USE_FEATURE 0
#endif
```
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/idl_features.h | 75 | ||||
-rw-r--r-- | TAO/tao/orbconf.h | 4 | ||||
-rw-r--r-- | TAO/tao/tao.mpc | 1 |
3 files changed, 80 insertions, 0 deletions
diff --git a/TAO/tao/idl_features.h b/TAO/tao/idl_features.h new file mode 100644 index 00000000000..40cc7d951b8 --- /dev/null +++ b/TAO/tao/idl_features.h @@ -0,0 +1,75 @@ +/** + * @file idl_features.h + * + * Get information about what IDL features the IDL compiler has, similarly to + * the "version" standard header in C++. + * + * In C++ it can be used like this if you want to be compatible with older + * versions of TAO: + * + * #include "tao/orbconf.h" + * #if defined TAO_HAS_IDL_FEATURES && TAO_HAS_IDL_FEATURES + * // Use this macro if you are using something that's not the max possible + * // version. + * # define TAO_IDL_IDL_VERSION 0x30000 + * # include "tao/idl_features.h" + * # define USE_FEATURE defined TAO_IDL_HAS_FEATURE && TAO_IDL_HAS_FEATURE + * #else + * # define USE_FEATURE 0 + * #endif + * + * In IDL it can be used like this if you want to be compatible with older + * versions of TAO: + * + * #if defined __TAO_IDL_FEATURES + * # include __TAO_IDL_FEATURES + * # define USE_FEATURE defined TAO_IDL_HAS_FEATURE && TAO_IDL_HAS_FEATURE + * #else + * # define USE_FEATURE 0 + * #endif + */ + +#ifndef TAO_IDL_FEATURES_H +#define TAO_IDL_FEATURES_H + +#ifndef TAO_IDL_IDL_VERSION +# ifdef __TAO_IDL_IDL_VERSION +# define TAO_IDL_IDL_VERSION __TAO_IDL_IDL_VERSION +# else +# define TAO_IDL_IDL_VERSION 0xffffffff +# endif +#endif + +#ifndef TAO_IDL_HAS_ANNOTATIONS +# define TAO_IDL_HAS_ANNOTATIONS TAO_IDL_IDL_VERSION >= 0x40000 +#endif + +#ifndef TAO_IDL_HAS_ANONYMOUS_TYPES +# define TAO_IDL_HAS_ANONYMOUS_TYPES TAO_IDL_IDL_VERSION >= 0x40000 +#endif + +#ifndef TAO_IDL_HAS_EXPLICIT_INTS +# define TAO_IDL_HAS_EXPLICIT_INTS TAO_IDL_IDL_VERSION >= 0x40000 +#endif + +#ifndef TAO_IDL_HAS_OCTET_AND_WCHAR_UNION_DISCS +# define TAO_IDL_HAS_OCTET_AND_WCHAR_UNION_DISCS 0 +#endif + +#ifndef TAO_IDL_HAS_STRUCT_INHERITANCE +# define TAO_IDL_HAS_STRUCT_INHERITANCE 0 +#endif + +#ifndef TAO_IDL_HAS_MAP +# define TAO_IDL_HAS_MAP 0 +#endif + +#ifndef TAO_IDL_HAS_BITSET +# define TAO_IDL_HAS_BITSET 0 +#endif + +#ifndef TAO_IDL_HAS_BITMASK +# define TAO_IDL_HAS_BITMASK 0 +#endif + +#endif diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index de5905aea50..7559a8b8e14 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -857,6 +857,10 @@ enum TAO_Policy_Scope # define TAO_DEFAULT_COLLOCATION_STRATEGY TAO_COLLOCATION_THRU_POA #endif +#ifndef TAO_HAS_IDL_FEATURES +# define TAO_HAS_IDL_FEATURES 1 +#endif + TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/TAO/tao/tao.mpc b/TAO/tao/tao.mpc index 64f85080969..14f122ee9d7 100644 --- a/TAO/tao/tao.mpc +++ b/TAO/tao/tao.mpc @@ -448,6 +448,7 @@ project(TAO) : acelib, install, tao_output, taodefaults, pidl, extra_core, taoid HTTP_Client.h HTTP_Handler.h HTTP_Parser.h + idl_features.h IFR_Client_Adapter.h IIOP_Acceptor.h IIOPC.h |