summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2013-03-29 13:12:52 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2013-03-29 13:12:52 +0000
commitf203ae2043a2f5e92e6c550f850958b913c126a7 (patch)
treeeb96842dee38f6c26b6d2e7ea8a64d3512b52e00
parent28bed92fa86e0a70f5e14da263856c123b6cfff0 (diff)
downloadATCD-f203ae2043a2f5e92e6c550f850958b913c126a7.tar.gz
Fri Mar 29 13:11:10 UTC 2013 Johnny Willemsen <jwillemsen@remedy.nl>
* MPC/config/tao_versioning_idl_defaults.mpb: Zapped empty line * TAO_IDL/be/be_codegen.cpp: * TAO_IDL/be/be_global.cpp: * TAO_IDL/be/be_util.cpp: * TAO_IDL/be_include/be_global.h: Added versioning_include to specify a different versioned header include and resolved some problems when trying to use versioned namespaces also for the application code
-rw-r--r--TAO/ChangeLog13
-rw-r--r--TAO/MPC/config/tao_versioning_idl_defaults.mpb1
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp7
-rw-r--r--TAO/TAO_IDL/be/be_global.cpp40
-rw-r--r--TAO/TAO_IDL/be/be_util.cpp12
-rw-r--r--TAO/TAO_IDL/be_include/be_global.h13
6 files changed, 71 insertions, 15 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 055eec7b4b8..d21f1627a77 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,16 @@
+Fri Mar 29 13:11:10 UTC 2013 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * MPC/config/tao_versioning_idl_defaults.mpb:
+ Zapped empty line
+
+ * TAO_IDL/be/be_codegen.cpp:
+ * TAO_IDL/be/be_global.cpp:
+ * TAO_IDL/be/be_util.cpp:
+ * TAO_IDL/be_include/be_global.h:
+ Added versioning_include to specify a different versioned
+ header include and resolved some problems when trying to
+ use versioned namespaces also for the application code
+
Fri Mar 29 12:26:13 UTC 2013 Johnny Willemsen <jwillemsen@remedy.nl>
* TAO_IDL/util/utl_err.cpp:
diff --git a/TAO/MPC/config/tao_versioning_idl_defaults.mpb b/TAO/MPC/config/tao_versioning_idl_defaults.mpb
index 23bc1208716..d270fd30b2d 100644
--- a/TAO/MPC/config/tao_versioning_idl_defaults.mpb
+++ b/TAO/MPC/config/tao_versioning_idl_defaults.mpb
@@ -8,5 +8,4 @@
project : taoidldefaults {
idlflags += -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL \
-Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL
-
}
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
index 09a88c38009..b6c53922f27 100644
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/TAO/TAO_IDL/be/be_codegen.cpp
@@ -2657,6 +2657,13 @@ TAO_CodeGen::gen_stub_hdr_includes (void)
"tao/Versioned_Namespace.h",
true);
+ if ((be_global->versioning_include () != 0) && (ACE_OS::strlen (be_global->versioning_include ()) > 0))
+ {
+ this->gen_standard_include (this->client_header_,
+ be_global->versioning_include (),
+ true);
+ }
+
// On some platforms, this include isn't needed if certain command
// line options are present. Rather than try to sort that all out,
// and to keep cross-compiling robust, we always generate this
diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp
index 2d130d48663..473aae36bc2 100644
--- a/TAO/TAO_IDL/be/be_global.cpp
+++ b/TAO/TAO_IDL/be/be_global.cpp
@@ -62,6 +62,7 @@ BE_GlobalData::BE_GlobalData (void)
core_versioning_end_ ("\nTAO_END_VERSIONED_NAMESPACE_DECL\n"),
versioning_begin_ (),
versioning_end_ (),
+ versioning_include_ (),
client_hdr_ending_ (ACE::strnew ("C.h")),
client_stub_ending_ (ACE::strnew ("C.cpp")),
client_inline_ending_ (ACE::strnew ("C.inl")),
@@ -1110,22 +1111,22 @@ BE_GlobalData::stripped_filename (const char *s)
this->stripped_filename_ = ACE::strnew (s);
}
-void
-BE_GlobalData::versioning_begin (const char * s)
+const char *
+BE_GlobalData::versioning_begin (void) const
{
- this->versioning_begin_ =
- ACE_CString ("\n\n")
- + ACE_CString (s)
- + ACE_CString ("\n\n");
+ return this->versioning_begin_.c_str ();
+}
- this->core_versioning_end_ += this->versioning_begin_;
- // Yes, "begin".
+void
+BE_GlobalData::versioning_include (const char * s)
+{
+ this->versioning_include_ = s;
}
const char *
-BE_GlobalData::versioning_begin (void) const
+BE_GlobalData::versioning_include (void) const
{
- return this->versioning_begin_.c_str ();
+ return this->versioning_include_.c_str ();
}
const char *
@@ -1143,8 +1144,23 @@ BE_GlobalData::versioning_end (const char * s)
+ ACE_CString ("\n\n");
this->core_versioning_begin_ =
- this->versioning_end_ // Yes, "end".
- + this->core_versioning_begin_; // Initialized in constructor.
+ this->versioning_end_ + // Yes, "end".
+ "\nTAO_BEGIN_VERSIONED_NAMESPACE_DECL\n";
+}
+
+void
+BE_GlobalData::versioning_begin (const char * s)
+{
+ this->versioning_begin_ =
+ ACE_CString ("\n\n")
+ + ACE_CString (s)
+ + ACE_CString ("\n\n");
+
+ this->core_versioning_end_ =
+ "\nTAO_END_VERSIONED_NAMESPACE_DECL\n"
+ + this->versioning_begin_; // Yes, "begin".
+
+ // Yes, "begin".
}
const char *
diff --git a/TAO/TAO_IDL/be/be_util.cpp b/TAO/TAO_IDL/be/be_util.cpp
index d55869c785d..b7d808aa071 100644
--- a/TAO/TAO_IDL/be/be_util.cpp
+++ b/TAO/TAO_IDL/be/be_util.cpp
@@ -147,6 +147,7 @@ be_util::prep_be_arg (char *s)
static const char arg_post_include[] = "post_include=";
static const char arg_versioning_begin[] = "versioning_begin=";
static const char arg_versioning_end[] = "versioning_end=";
+ static const char arg_versioning_include[] = "versioning_include=";
static const char obv_opt_accessor[] = "obv_opt_accessor";
static const char ciao_container_type[] = "ciao_container_type=";
static const char include_guard[] = "include_guard=";
@@ -299,6 +300,12 @@ be_util::prep_be_arg (char *s)
arg + sizeof (arg_versioning_end) - 1;
be_global->versioning_end (val);
}
+ else if (ACE_OS::strstr (arg, arg_versioning_include) == arg)
+ {
+ char const * const val =
+ arg + sizeof (arg_versioning_include) - 1;
+ be_global->versioning_include (val);
+ }
else if (ACE_OS::strstr (arg, dds_impl) == arg)
{
char const * const val =
@@ -524,6 +531,11 @@ be_util::usage (void)
ACE_TEXT (" -Wb,versioning_end\t\t\tSet text that closes a ")
ACE_TEXT ("a \"versioned\" namespace\n")
));
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT (" -Wb,versioning_include\t\t\tSet text that will be used as include for ")
+ ACE_TEXT ("a \"versioned\" namespace\n")
+ ));
#endif /* ACE_HAS_VERSIONED_NAMESPACE || TAO_HAS_VERSIONED_NAMESPACE */
ACE_DEBUG ((
LM_DEBUG,
diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h
index 560281e9ab0..919d04a6ffb 100644
--- a/TAO/TAO_IDL/be_include/be_global.h
+++ b/TAO/TAO_IDL/be_include/be_global.h
@@ -417,6 +417,12 @@ public:
/// Get text that opens a "versioned" namespace.
const char * versioning_begin (void) const;
+ /// Set include file for "versioned" namespace.
+ void versioning_include (const char* s);
+
+ /// Get include file for "versioned" namespace.
+ const char * versioning_include (void) const;
+
/// Get text that opens a "versioned" namespace for core TAO/orbsvcs
/// related code.
const char * core_versioning_begin (void) const;
@@ -963,12 +969,15 @@ private:
/// orbsvcs related code.
ACE_CString core_versioning_end_;
- /// Text that opens a "versioned" namepace.
+ /// Text that opens a "versioned" namespace.
ACE_CString versioning_begin_;
- /// Text that closes a "versioned" namepace.
+ /// Text that closes a "versioned" namespace.
ACE_CString versioning_end_;
+ /// Include for versioned namespace include
+ ACE_CString versioning_include_;
+
/// Client's header file name ending. Default is "C.h".
char* client_hdr_ending_;