diff options
Diffstat (limited to 'ace/OS.h')
-rw-r--r-- | ace/OS.h | 52 |
1 files changed, 41 insertions, 11 deletions
@@ -46,21 +46,51 @@ # endif /* defined (ACE_LACKS_INLINE_FUNCTIONS) && !defined (ACE_NO_INLINE) */ # if defined (ACE_HAS_ANSI_CASTS) -# define ACE_static_cast(TYPE, EXPR) static_cast<TYPE> (EXPR) -# define ACE_const_cast(TYPE, EXPR) const_cast<TYPE> (EXPR) -# define ACE_reinterpret_cast(TYPE, EXPR) reinterpret_cast<TYPE> (EXPR) +# define ACE_sap_any_cast(TYPE) reinterpret_cast<TYPE> (const_cast<ACE_Addr &> (ACE_Addr::sap_any)) +# define ACE_static_cast(TYPE, EXPR) static_cast<TYPE> (EXPR) +# define ACE_const_cast(TYPE, EXPR) const_cast<TYPE> (EXPR) +# define ACE_reinterpret_cast(TYPE, EXPR) reinterpret_cast<TYPE> (EXPR) # if defined (ACE_LACKS_RTTI) -# define ACE_dynamic_cast(TYPE, EXPR) static_cast<TYPE> (EXPR) +# define ACE_dynamic_cast(TYPE, EXPR) static_cast< TYPE > (EXPR) +# define ACE_dynamic_cast_1_ptr(TYPE, T1, EXPR) static_cast< TYPE<T1> *> (EXPR) +# define ACE_dynamic_cast_2_ptr(TYPE, T1, T2, EXPR) static_cast< TYPE<T1, T2> *> (EXPR) +# define ACE_dynamic_cast_3_ptr(TYPE, T1, T2, T3, EXPR) static_cast< TYPE<T1, T2, T3> *> (EXPR) +# define ACE_dynamic_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) static_cast< TYPE<T1, T2, T3, T4> *> (EXPR) +# define ACE_dynamic_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) static_cast< TYPE<T1, T2, T3, T4, T5> *> (EXPR) +# define ACE_dynamic_cast_1_ref(TYPE, T1, EXPR) static_cast< TYPE<T1> &> (EXPR) +# define ACE_dynamic_cast_2_ref(TYPE, T1, T2, EXPR) static_cast< TYPE<T1, T2> &> (EXPR) +# define ACE_dynamic_cast_3_ref(TYPE, T1, T2, T3, EXPR) static_cast< TYPE<T1, T2, T3> &> (EXPR) +# define ACE_dynamic_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) static_cast< TYPE<T1, T2, T3, T4> &> (EXPR) +# define ACE_dynamic_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) static_cast< TYPE<T1, T2, T3, T4, T5> &> (EXPR) # else /* ! ACE_LACKS_RTTI */ -# define ACE_dynamic_cast(TYPE, EXPR) dynamic_cast<TYPE> (EXPR) +# define ACE_dynamic_cast(TYPE, EXPR) dynamic_cast< TYPE > (EXPR) +# define ACE_dynamic_cast_1_ptr(TYPE, T1, EXPR) dynamic_cast< TYPE<T1> *> (EXPR) +# define ACE_dynamic_cast_2_ptr(TYPE, T1, T2, EXPR) dynamic_cast< TYPE<T1, T2> *> (EXPR) +# define ACE_dynamic_cast_3_ptr(TYPE, T1, T2, T3, EXPR) dynamic_cast< TYPE<T1, T2, T3> *> (EXPR) +# define ACE_dynamic_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) dynamic_cast< TYPE<T1, T2, T3, T4> *> (EXPR) +# define ACE_dynamic_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) dynamic_cast< TYPE<T1, T2, T3, T4, T5> *> (EXPR) +# define ACE_dynamic_cast_1_ref(TYPE, T1, EXPR) dynamic_cast< TYPE<T1> &> (EXPR) +# define ACE_dynamic_cast_2_ref(TYPE, T1, T2, EXPR) dynamic_cast< TYPE<T1, T2> &> (EXPR) +# define ACE_dynamic_cast_3_ref(TYPE, T1, T2, T3, EXPR) dynamic_cast< TYPE<T1, T2, T3> &> (EXPR) +# define ACE_dynamic_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) dynamic_cast< TYPE<T1, T2, T3, T4> &> (EXPR) +# define ACE_dynamic_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) dynamic_cast< TYPE<T1, T2, T3, T4, T5> &> (EXPR) # endif /* ! ACE_LACKS_RTTI */ -# define ACE_sap_any_cast(TYPE) reinterpret_cast<TYPE> (const_cast<ACE_Addr &> (ACE_Addr::sap_any)) # else -# define ACE_static_cast(TYPE, EXPR) ((TYPE) (EXPR)) -# define ACE_const_cast(TYPE, EXPR) ((TYPE) (EXPR)) -# define ACE_reinterpret_cast(TYPE, EXPR) ((TYPE) (EXPR)) -# define ACE_dynamic_cast(TYPE, EXPR) ((TYPE) (EXPR)) -# define ACE_sap_any_cast(TYPE) ((TYPE) (ACE_Addr::sap_any)) +# define ACE_sap_any_cast(TYPE) ((TYPE) (ACE_Addr::sap_any)) +# define ACE_static_cast(TYPE, EXPR) ((TYPE) (EXPR)) +# define ACE_const_cast(TYPE, EXPR) ((TYPE) (EXPR)) +# define ACE_reinterpret_cast(TYPE, EXPR) ((TYPE) (EXPR)) +# define ACE_dynamic_cast(TYPE, EXPR) ((TYPE) (EXPR)) +# define ACE_dynamic_cast_1_ptr(TYPE, T1, EXPR) ((TYPE<T1> *) (EXPR)) +# define ACE_dynamic_cast_2_ptr(TYPE, T1, T2, EXPR) ((TYPE<T1, T2> *) (EXPR)) +# define ACE_dynamic_cast_3_ptr(TYPE, T1, T2, T3, EXPR) ((TYPE<T1, T2, T3> *) (EXPR)) +# define ACE_dynamic_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) ((TYPE<T1, T2, T3, T4> *) (EXPR)) +# define ACE_dynamic_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) ((TYPE<T1, T2, T3, T4, T5> *) (EXPR)) +# define ACE_dynamic_cast_1_ref(TYPE, T1, EXPR) ((TYPE<T1> &) (EXPR)) +# define ACE_dynamic_cast_2_ref(TYPE, T1, T2, EXPR) ((TYPE<T1, T2> &) (EXPR)) +# define ACE_dynamic_cast_3_ref(TYPE, T1, T2, T3, EXPR) ((TYPE<T1, T2, T3> &) (EXPR)) +# define ACE_dynamic_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) ((TYPE<T1, T2, T3, T4> &) (EXPR)) +# define ACE_dynamic_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) ((TYPE<T1, T2, T3, T4, T5> &) (EXPR)) # endif /* ACE_HAS_ANSI_CASTS */ # if !defined (ACE_CAST_CONST) |