diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-12-04 03:15:22 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-12-04 03:15:22 +0000 |
commit | 767e85dc53259876d6a51fd6177abad834906e97 (patch) | |
tree | 847aaf4957ad89583805d699ed659ab140e4e155 | |
parent | ab4fa3b075993f4bae173e82120416497a52031a (diff) | |
download | ATCD-767e85dc53259876d6a51fd6177abad834906e97.tar.gz |
ChangeLogTag:Mon Dec 3 19:12:58 2001 Carlos O'Ryan <coryan@uci.edu>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 13 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp | 24 | ||||
-rw-r--r-- | TAO/tao/orbconf.h | 107 |
3 files changed, 108 insertions, 36 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 448a2569307..d5937091998 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,16 @@ +Mon Dec 3 19:12:58 2001 Carlos O'Ryan <coryan@uci.edu> + + * tao/orbconf.h: + Documented the TAO_ENV_* macros using Doxygen + Add new macro to generate code only if the build is using + CORBA::Environment arguments. + + * orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp: + My change was not that great after all, it generated warnings on + the Linux build with exceptions enabled. + I have fixed the problem by taking advantage of a + TAO_ENV_EMIT_CODE macro. + Mon Dec 03 13:51:28 2001 Carlos O'Ryan <coryan@uci.edu> * orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp: diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp index 0c404251601..f481d4f1bac 100644 --- a/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp +++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp @@ -18,14 +18,14 @@ TAO_ESF_Connected_Command<Target,Object>::execute (void* arg) { if (arg != 0) { - CORBA::Environment &ACE_TRY_ENV = - *ACE_static_cast(CORBA::Environment*, arg); + TAO_ENV_EMIT_CODE (CORBA::Environment &ACE_TRY_ENV = + *ACE_static_cast(CORBA::Environment*, arg)); this->target_->connected_i (this->object_ TAO_ENV_ARG_PARAMETER); } else { - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment (); + TAO_ENV_EMIT_CODE (TAO_ENV_DECLARE_NEW_ENV); this->target_->connected_i (this->object_ TAO_ENV_ARG_PARAMETER); } @@ -44,14 +44,14 @@ TAO_ESF_Reconnected_Command<Target,Object>::execute (void* arg) if (arg != 0) { - CORBA::Environment &ACE_TRY_ENV = - *ACE_static_cast(CORBA::Environment*, arg); + TAO_ENV_EMIT_CODE (CORBA::Environment &ACE_TRY_ENV = + *ACE_static_cast(CORBA::Environment*, arg)); this->target_->reconnected_i (this->object_ TAO_ENV_ARG_PARAMETER); } else { - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment (); + TAO_ENV_EMIT_CODE (TAO_ENV_DECLARE_NEW_ENV); this->target_->reconnected_i (this->object_ TAO_ENV_ARG_PARAMETER); } @@ -65,14 +65,14 @@ TAO_ESF_Disconnected_Command<Target,Object>::execute (void* arg) { if (arg != 0) { - CORBA::Environment &ACE_TRY_ENV = - *ACE_static_cast(CORBA::Environment*, arg); + TAO_ENV_EMIT_CODE (CORBA::Environment &ACE_TRY_ENV = + *ACE_static_cast(CORBA::Environment*, arg)); this->target_->disconnected_i (this->object_ TAO_ENV_ARG_PARAMETER); } else { - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment (); + TAO_ENV_EMIT_CODE (TAO_ENV_DECLARE_NEW_ENV); this->target_->disconnected_i (this->object_ TAO_ENV_ARG_PARAMETER); } @@ -86,13 +86,13 @@ TAO_ESF_Shutdown_Command<Target>::execute (void* arg) { if (arg != 0) { - CORBA::Environment &ACE_TRY_ENV = - *ACE_static_cast(CORBA::Environment*, arg); + TAO_ENV_EMIT_CODE (CORBA::Environment &ACE_TRY_ENV = + *ACE_static_cast(CORBA::Environment*, arg)); this->target_->shutdown_i (TAO_ENV_SINGLE_ARG_PARAMETER); } else { - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment (); + TAO_ENV_EMIT_CODE (TAO_ENV_DECLARE_NEW_ENV); this->target_->shutdown_i (TAO_ENV_SINGLE_ARG_PARAMETER); } return 0; diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index c2e6a17bed4..3e397e6d690 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -226,35 +226,94 @@ #endif /* TAO_HAS_EXCEPTIONS */ #if !defined (TAO_HAS_EXCEPTIONS) || defined (TAO_ENV_BKWD_COMPAT) -#define TAO_ENV_ARG_DECL , CORBA::Environment &ACE_TRY_ENV -#define TAO_ENV_ARG_DECL_WITH_DEFAULTS , CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () -#define TAO_ENV_ARG_DECL_NOT_USED , CORBA::Environment & -#define TAO_ENV_ARG_PARAMETER ,ACE_TRY_ENV -#define TAO_ENV_SINGLE_ARG_DECL CORBA::Environment &ACE_TRY_ENV -#define TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () -#define TAO_ENV_SINGLE_ARG_DECL_NOT_USED CORBA::Environment & -#define TAO_ENV_SINGLE_ARG_PARAMETER ACE_TRY_ENV -#define TAO_ENV_ARG_NOT_USED ACE_UNUSED_ARG (ACE_TRY_ENV) -#define TAO_ENV_ARG_DEFN /* Please do not use, obsolescent. Instead: */ -#define TAO_ENV_DECLARE_NEW_ENV ACE_DECLARE_NEW_CORBA_ENV +//@{ +/** + * @name Native C++ exceptions portability macros. + * + * The following macros + */ +/// Define a macro to emit code only when CORBA::Environment is used +# define TAO_ENV_EMIT_CODE(X) X + +/// Declare a CORBA::Environment argument as the last argument of a +/// function +/** + * Normally this macro is used as follows: + * + * <CODE>void my_funct (int x, int y TAO_ENV_ARG_DECL);</CODE> + * + * Its purpose is to provide TAO developers (and users) with a + * mechanism to write code that is portable to platforms with and + * without native C++ exceptions. + */ +# define TAO_ENV_ARG_DECL ,CORBA::Environment &ACE_TRY_ENV + +/// Declare a CORBA::Environment argument with the default value +/// obtained from the TAO orb. Similar to TAO_ENV_ARG_DECL +# define TAO_ENV_ARG_DECL_WITH_DEFAULTS ,CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () + +/// Declare a CORBA::Environment argument that is not used by the +/// function definition. +/** + * Similar to TAO_ENV_ARG_DECL, but the formal parameter name is + * dropped to avoid warnings about unused parameters + */ +# define TAO_ENV_ARG_DECL_NOT_USED ,CORBA::Environment & + +/// Declare a CORBA::Environment argument for methods that do not take +/// any other parameters +# define TAO_ENV_SINGLE_ARG_DECL CORBA::Environment &ACE_TRY_ENV + +/// Declare a CORBA::Environment argument with a default value for +/// methods that do not take any other parameters +# define TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () + +/// Declare a CORBA::Environment argument for for ethods +# define TAO_ENV_SINGLE_ARG_DECL_NOT_USED CORBA::Environment & + +/// Use the CORBA::Environment argument is a nested call +# define TAO_ENV_ARG_PARAMETER ,ACE_TRY_ENV + +/// Use the CORBA::Environment argument is a nested call, assuming the +/// called function take only the ACE_TRY_ENV argument. +# define TAO_ENV_SINGLE_ARG_PARAMETER ACE_TRY_ENV + +/// Eliminate unused argument warnings about ACE_TRY_ENV +# define TAO_ENV_ARG_NOT_USED ACE_UNUSED_ARG (ACE_TRY_ENV) + +/** + * @todo Please do not use, obsolescent. Use TAO_ENV_DECLARE_NEW_ENV + * instead + */ +# define TAO_ENV_ARG_DEFN + +/// Declare a CORBA::Environment variable. +/** + * Used in methods that do not take such an argument, or do not take + * it when compiled with native C++ exceptions, but use the argument + * in all platforms + */ +# define TAO_ENV_DECLARE_NEW_ENV ACE_DECLARE_NEW_CORBA_ENV #else -#define TAO_ENV_ARG_DECL -#define TAO_ENV_ARG_DECL_WITH_DEFAULTS -#define TAO_ENV_ARG_DECL_NOT_USED -#define TAO_ENV_ARG_PARAMETER -#define TAO_ENV_SINGLE_ARG_DECL -#define TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS -#define TAO_ENV_SINGLE_ARG_DECL_NOT_USED -#define TAO_ENV_SINGLE_ARG_PARAMETER -#define TAO_ENV_ARG_NOT_USED -#define TAO_ENV_ARG_DEFN CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () -#define TAO_ENV_DECLARE_NEW_ENV +# define TAO_ENV_EMIT_CODE(X) +# define TAO_ENV_ARG_DECL +# define TAO_ENV_ARG_DECL_WITH_DEFAULTS +# define TAO_ENV_ARG_DECL_NOT_USED +# define TAO_ENV_ARG_PARAMETER +# define TAO_ENV_SINGLE_ARG_DECL +# define TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS +# define TAO_ENV_SINGLE_ARG_DECL_NOT_USED +# define TAO_ENV_SINGLE_ARG_PARAMETER +# define TAO_ENV_ARG_NOT_USED +# define TAO_ENV_ARG_DEFN CORBA::Environment &ACE_TRY_ENV = TAO_default_environment () +# define TAO_ENV_DECLARE_NEW_ENV #endif /* TAO_HAS_EXCEPTIONS */ + #if !defined (TAO_HAS_EXCEPTIONS) // This thing can be moved into the above when we drop TAO_ENV_BKWD_COMPAT. -#define TAO_ENV_RAISE(ex) ACE_TRY_ENV.exception (ex) +# define TAO_ENV_RAISE(ex) ACE_TRY_ENV.exception (ex) #else -#define TAO_ENV_RAISE(ex) (ex)->_raise () +# define TAO_ENV_RAISE(ex) (ex)->_raise () #endif /* TAO_HAS_EXCEPTIONS */ // BC++ seems to have a different convention for detecting Win32 than |