summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-30 22:00:18 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-30 22:00:18 +0000
commit5ec22d6097fcaa4debe9e2f8fa7b4bd5f9fed0aa (patch)
treeaf30164cfe7a1fe3dc034c91650431c3238f0e9b /TAO/TAO_IDL/be
parent67bba3819b059270155fa70685e95fb0855f9402 (diff)
downloadATCD-5ec22d6097fcaa4debe9e2f8fa7b4bd5f9fed0aa.tar.gz
ChangeLogTag:Fri Jan 30 15:35:06 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'TAO/TAO_IDL/be')
-rw-r--r--TAO/TAO_IDL/be/be_args.cpp28
-rw-r--r--TAO/TAO_IDL/be/be_array.cpp15
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp7
-rw-r--r--TAO/TAO_IDL/be/be_enum.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_exception.cpp9
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp18
-rw-r--r--TAO/TAO_IDL/be/be_interface_fwd.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_module.cpp10
-rw-r--r--TAO/TAO_IDL/be/be_sequence.cpp18
-rw-r--r--TAO/TAO_IDL/be/be_structure.cpp12
-rw-r--r--TAO/TAO_IDL/be/be_typedef.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_union.cpp15
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence.cpp4
14 files changed, 117 insertions, 41 deletions
diff --git a/TAO/TAO_IDL/be/be_args.cpp b/TAO/TAO_IDL/be/be_args.cpp
index f4ee9159feb..6416609a684 100644
--- a/TAO/TAO_IDL/be/be_args.cpp
+++ b/TAO/TAO_IDL/be/be_args.cpp
@@ -74,6 +74,32 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
* Since this is the dummy BE, it doesn't do anything with the passed string
*/
void
-BE_prep_arg(char *, idl_bool)
+BE_prep_arg(char *s, idl_bool)
{
+ const char arg_macro[]="export_macro=";
+ const char arg_include[]="export_include=";
+
+ char* last = 0;
+ for (char* arg = ACE_OS::strtok_r (s, ",", &last);
+ arg != 0;
+ arg = ACE_OS::strtok_r (0, ",", &last))
+ {
+ if (ACE_OS::strstr (arg, arg_macro) == arg)
+ {
+ char* val = arg + sizeof (arg_macro) - 1;
+ idl_global->export_macro (val);
+ }
+ else if (ACE_OS::strstr (arg, arg_include) == arg)
+ {
+ char* val = arg + sizeof (arg_include) - 1;
+ idl_global->export_include (val);
+ }
+ else
+ {
+ cerr << idl_global->prog_name ()
+ << ": invalid or unknown argument <"
+ << arg
+ << "> to back end\n";
+ }
+ }
}
diff --git a/TAO/TAO_IDL/be/be_array.cpp b/TAO/TAO_IDL/be/be_array.cpp
index b6515710a0c..8acbba649a7 100644
--- a/TAO/TAO_IDL/be/be_array.cpp
+++ b/TAO/TAO_IDL/be/be_array.cpp
@@ -315,8 +315,10 @@ be_array::gen_client_header (void)
{
// we are in the ROOT scope
ch->indent ();
- *ch << "extern CORBA::TypeCode_ptr " << this->tc_name
- ()->last_component () << ";\n\n";
+ *ch << "extern "
+ << idl_global->export_macro ()
+ << " CORBA::TypeCode_ptr "
+ << this->tc_name ()->last_component () << ";\n\n";
}
ch->gen_endif ();
@@ -617,7 +619,8 @@ be_array::gen_var_defn (void)
// for over here.
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
@@ -891,7 +894,8 @@ be_array::gen_out_defn (void)
// generate the out definition (always in the client header)
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
@@ -1072,7 +1076,8 @@ be_array::gen_forany_defn (void)
// for over here.
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
index d1214f1a8b9..1c0e5b709a9 100644
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/TAO/TAO_IDL/be/be_codegen.cpp
@@ -220,6 +220,13 @@ TAO_CodeGen::client_header (const char *fname)
this->client_header_->print ("#define %s\n\n", macro_name);
*this->client_header_ << "#include \"tao/corba.h\"\n";
+ if (idl_global->export_include () != 0)
+ {
+ *this->client_header_ << "#include \""
+ << idl_global->export_include ()
+ << "\"\n";
+ }
+
// We must include all the skeleton headers corresponding to
// IDL files included by the current IDL file.
for (size_t j = 0;
diff --git a/TAO/TAO_IDL/be/be_enum.cpp b/TAO/TAO_IDL/be/be_enum.cpp
index f4431c30d77..adbaecb6b63 100644
--- a/TAO/TAO_IDL/be/be_enum.cpp
+++ b/TAO/TAO_IDL/be/be_enum.cpp
@@ -139,8 +139,10 @@ be_enum::gen_client_header (void)
{
// we are in the ROOT scope
ch->indent ();
- *ch << "extern CORBA::TypeCode_ptr " << this->tc_name
- ()->last_component () << ";\n\n";
+ *ch << "extern "
+ << idl_global->export_macro ()
+ << "CORBA::TypeCode_ptr "
+ << this->tc_name ()->last_component () << ";\n\n";
}
this->cli_hdr_gen_ = I_TRUE;
}
diff --git a/TAO/TAO_IDL/be/be_exception.cpp b/TAO/TAO_IDL/be/be_exception.cpp
index e3c5db792fc..cc9d405ff9a 100644
--- a/TAO/TAO_IDL/be/be_exception.cpp
+++ b/TAO/TAO_IDL/be/be_exception.cpp
@@ -113,7 +113,8 @@ be_exception::gen_client_header (void)
ch->gen_ifdef_macro (this->flatname ());
ch->indent ();
- *ch << "class " << this->local_name ()
+ *ch << "class " << idl_global->export_macro ()
+ << " " << this->local_name ()
<< " : public CORBA::UserException" << nl;
*ch << "{" << nl
<< "public:\n";
@@ -175,8 +176,10 @@ be_exception::gen_client_header (void)
{
// we are in the ROOT scope
ch->indent ();
- *ch << "extern CORBA::TypeCode_ptr " << this->tc_name
- ()->last_component () << ";\n\n";
+ *ch << "extern "
+ << idl_global->export_macro ()
+ << " CORBA::TypeCode_ptr "
+ << this->tc_name ()->last_component () << ";\n\n";
}
ch->gen_endif ();
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
index d75afa50673..032bd30a245 100644
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ b/TAO/TAO_IDL/be/be_interface.cpp
@@ -304,7 +304,8 @@ be_interface::gen_client_header (void)
// now generate the class definition
ch->indent ();
- *ch << "class " << this->local_name ();
+ *ch << "class " << idl_global->export_macro ()
+ << " " << this->local_name ();
if (n_inherits () > 0) // this interface inherits from other interfaces
{
@@ -412,8 +413,10 @@ be_interface::gen_client_header (void)
{
// we are in the ROOT scope
ch->indent ();
- *ch << "extern CORBA::TypeCode_ptr " << this->tc_name
- ()->last_component () << ";\n\n";
+ *ch << "extern "
+ << idl_global->export_macro ()
+ << " CORBA::TypeCode_ptr "
+ << this->tc_name ()->last_component () << ";\n\n";
}
cg->pop ();
@@ -691,7 +694,8 @@ int be_interface::gen_server_header (void)
<< "_ptr;" << nl;
// now generate the class definition
- *sh << "class " << namebuf << " : ";
+ *sh << "class " << idl_global->export_macro ()
+ << " " << namebuf << " : ";
if (n_inherits () > 0) // this interface inherits from other interfaces
{
be_interface *intf;
@@ -1076,7 +1080,8 @@ be_interface::gen_var_defn (void)
// for over here.
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
@@ -1336,7 +1341,8 @@ be_interface::gen_out_defn (void)
// generate the out definition (always in the client header)
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
diff --git a/TAO/TAO_IDL/be/be_interface_fwd.cpp b/TAO/TAO_IDL/be/be_interface_fwd.cpp
index cf1b0345ce3..48a104b2dc0 100644
--- a/TAO/TAO_IDL/be/be_interface_fwd.cpp
+++ b/TAO/TAO_IDL/be/be_interface_fwd.cpp
@@ -181,7 +181,8 @@ be_interface_fwd::gen_var_defn (void)
// for over here.
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
@@ -441,7 +442,8 @@ be_interface_fwd::gen_out_defn (void)
// generate the out definition (always in the client header)
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
diff --git a/TAO/TAO_IDL/be/be_module.cpp b/TAO/TAO_IDL/be/be_module.cpp
index 544b322987e..19ce7adca4b 100644
--- a/TAO/TAO_IDL/be/be_module.cpp
+++ b/TAO/TAO_IDL/be/be_module.cpp
@@ -57,7 +57,8 @@ int be_module::gen_client_header (void)
ch->indent (); // start with whatever indentation level we are at
// now generate the class definition
- *ch << "class " << local_name ();
+ *ch << "class " << idl_global->export_macro ()
+ << " " << local_name ();
// generate the body
*ch << "{" << nl;
@@ -117,12 +118,15 @@ int be_module::gen_server_header (void)
// now generate the class definition. The prefix POA_ is prepended to our
// name only if we are the outermost module
d = ScopeAsDecl (this->defined_in ());
+
+ *sh << "class " << idl_global->export_macro ()
+ << " ";
if (d->node_type () == AST_Decl::NT_root)
// we are outermost module
- *sh << "class POA_" << local_name () << nl;
+ *sh << "POA_" << local_name () << nl;
else
// we are inside another module
- *sh << "class " << local_name () << nl;
+ *sh << local_name () << nl;
*sh << "{" << nl;
*sh << "public:\n";
diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp
index 85ed898c6c2..470e9a3ce41 100644
--- a/TAO/TAO_IDL/be/be_sequence.cpp
+++ b/TAO/TAO_IDL/be/be_sequence.cpp
@@ -242,7 +242,8 @@ be_sequence::gen_client_header (void)
*ch << "// *************************************************************"
<< nl << nl;
- *ch << "class " << this->local_name () << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << this->local_name () << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent (0);
@@ -424,8 +425,10 @@ be_sequence::gen_client_header (void)
{
// we are in the ROOT scope
ch->indent ();
- *ch << "extern CORBA::TypeCode_ptr " << this->tc_name
- ()->last_component () << ";\n\n";
+ *ch << "extern "
+ << idl_global->export_macro ()
+ << " CORBA::TypeCode_ptr "
+ << this->tc_name ()->last_component () << ";\n\n";
}
ch->gen_endif (); // endif macro
@@ -1249,7 +1252,8 @@ be_sequence::gen_var_defn (void)
// for over here.
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
@@ -1662,7 +1666,8 @@ be_sequence::gen_out_defn (void)
// generate the out definition (always in the client header)
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
@@ -1994,7 +1999,8 @@ be_sequence::gen_managed_type_ch (void)
}
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
diff --git a/TAO/TAO_IDL/be/be_structure.cpp b/TAO/TAO_IDL/be/be_structure.cpp
index 4f8471b7213..f0444fb26c0 100644
--- a/TAO/TAO_IDL/be/be_structure.cpp
+++ b/TAO/TAO_IDL/be/be_structure.cpp
@@ -135,8 +135,10 @@ be_structure::gen_client_header (void)
{
// we are in the ROOT scope
ch->indent ();
- *ch << "extern CORBA::TypeCode_ptr " << this->tc_name
- ()->last_component () << ";\n\n";
+ *ch << "extern "
+ << idl_global->export_macro ()
+ << " CORBA::TypeCode_ptr "
+ << this->tc_name ()->last_component () << ";\n\n";
}
this->cli_hdr_gen_ = I_TRUE;
cg->pop (); // pop up the current state
@@ -271,7 +273,8 @@ be_structure::gen_var_defn (void)
// for over here.
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
@@ -578,7 +581,8 @@ be_structure::gen_out_defn (void)
// generate the out definition (always in the client header)
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
diff --git a/TAO/TAO_IDL/be/be_typedef.cpp b/TAO/TAO_IDL/be/be_typedef.cpp
index 5a584c9d145..26738aebcad 100644
--- a/TAO/TAO_IDL/be/be_typedef.cpp
+++ b/TAO/TAO_IDL/be/be_typedef.cpp
@@ -85,8 +85,10 @@ be_typedef::gen_client_header (void)
{
// we are in the ROOT scope
ch->indent ();
- *ch << "extern CORBA::TypeCode_ptr " << this->tc_name
- ()->last_component () << ";\n\n";
+ *ch << "extern "
+ << idl_global->export_macro ()
+ << " CORBA::TypeCode_ptr "
+ << this->tc_name ()->last_component () << ";\n\n";
}
cg->pop ();
diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp
index 13fdaecdad1..7a158726a31 100644
--- a/TAO/TAO_IDL/be/be_union.cpp
+++ b/TAO/TAO_IDL/be/be_union.cpp
@@ -145,7 +145,8 @@ be_union::gen_client_header (void)
// generate the ifdefined macro for the array type
ch->gen_ifdef_macro (this->flatname ());
ch->indent (); // start with the current indentation level
- *ch << "class " << local_name () << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << local_name () << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
@@ -242,8 +243,10 @@ be_union::gen_client_header (void)
{
// we are in the ROOT scope
ch->indent ();
- *ch << "extern CORBA::TypeCode_ptr " << this->tc_name
- ()->last_component () << ";\n\n";
+ *ch << "extern "
+ << idl_global->export_macro ()
+ << " CORBA::TypeCode_ptr "
+ << this->tc_name ()->last_component () << ";\n\n";
}
ch->gen_endif ();
@@ -537,7 +540,8 @@ be_union::gen_var_defn (void)
// for over here.
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
@@ -844,7 +848,8 @@ be_union::gen_out_defn (void)
// generate the out definition (always in the client header)
ch->indent (); // start with whatever was our current indent level
- *ch << "class " << namebuf << nl;
+ *ch << "class " << idl_global->export_macro ()
+ << " " << namebuf << nl;
*ch << "{" << nl;
*ch << "public:\n";
ch->incr_indent ();
diff --git a/TAO/TAO_IDL/be/be_visitor_interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface.cpp
index baa3059fee4..c8161d704f8 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface.cpp
@@ -3,6 +3,7 @@
//
#include "idl.h"
+#include "global_extern.h"
#include "nr_extern.h"
#include "be.h"
#include "be_visitor_args.h"
@@ -26,7 +27,8 @@ int be_visitor_collocated_sh::visit_interface (be_interface *node)
os->gen_ifdef_macro (node->flatname (), "_collocated");
os->indent ();
- *os << "class " << node->local_coll_name ();
+ *os << "class " << idl_global->export_macro ()
+ << " " << node->local_coll_name ();
os->incr_indent ();
*os << ": public virtual " << node->name ();
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence.cpp b/TAO/TAO_IDL/be/be_visitor_sequence.cpp
index 36a6f661f94..07986da195b 100644
--- a/TAO/TAO_IDL/be/be_visitor_sequence.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_sequence.cpp
@@ -136,7 +136,9 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node)
{
// we are in the ROOT scope
os.indent ();
- os << "extern CORBA::TypeCode_ptr "
+ os << "extern "
+ << idl_global->export_macro ()
+ << " CORBA::TypeCode_ptr "
<< node->tc_name ()->last_component () << ";\n\n";
}