summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-12-30 15:28:09 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-12-30 15:28:09 +0000
commite350515b4adb6000dddf47ae00e031afbc8f5079 (patch)
tree8f4972239708d2ef2c356d0b7d0e90a89558a8d9
parent7e590a1cbe1f7d9905d1ab22affc5247bf57f012 (diff)
downloadATCD-e350515b4adb6000dddf47ae00e031afbc8f5079.tar.gz
ChangeLogTag: Mon Dec 30 08:49:31 2002 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog8
-rw-r--r--TAO/TAO_IDL/util/utl_global.cpp32
2 files changed, 33 insertions, 7 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 6caa273a64d..9159c76aedb 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,11 @@
+Mon Dec 30 08:49:31 2002 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/util/utl_global.cpp:
+
+ Fixed bug in #pragma prefix when the prefix directive is followed by
+ an #include directive. Thanks to Adee Ran <adeeran@yahoo.com> for
+ reporting the bug.
+
Mon Dec 30 06:12:53 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
* examples/AMH/Sink_Server/st_server.dsp (USERDEP__TEST_):
diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp
index 669688e6bc7..1d64e2877a4 100644
--- a/TAO/TAO_IDL/util/utl_global.cpp
+++ b/TAO/TAO_IDL/util/utl_global.cpp
@@ -935,13 +935,20 @@ IDL_GlobalData::pragma_prefixes (void)
void
IDL_GlobalData::update_prefix (char *filename)
{
- UTL_String *fname = idl_global->filename ();
+ // If we are just starting up and processing the temporary filename,
+ // there are no prefix issues to deal with yet.
+ if (this->pd_main_filename == 0 || this->pd_filename == 0)
+ {
+ return;
+ }
+
+ char *fstring = this->pd_filename->get_string ();
// We have to do this check because some preprocessors (gcc 3.2
// on RedHat Linux 7.1, for one) output the same filename
// multiple times for no apparent reason, and we don't want it
// to clear the prefix.
- if (fname && ACE_OS::strcmp (fname->get_string (), filename) == 0)
+ if (ACE_OS::strcmp (fstring, filename) == 0)
{
return;
}
@@ -949,11 +956,22 @@ IDL_GlobalData::update_prefix (char *filename)
ACE_CString tmp ("", 0, 0);
ACE_CString fn (filename, 0, 0);
(void) this->file_prefixes_.trybind (fn, tmp);
- char *trash = 0;
- this->pragma_prefixes_.pop (trash);
- delete [] trash;
- this->pragma_prefixes_.push (tmp.rep ());
- this->pd_root->prefix ((char *) tmp.fast_rep ());
+
+ if (ACE_OS::strcmp (fstring, this->pd_main_filename->get_string ()) != 0
+ && this->pragma_prefixes_.size () > 1)
+ {
+ char *trash = 0;
+ this->pragma_prefixes_.pop (trash);
+ delete [] trash;
+ char *current = 0;
+ this->pragma_prefixes_.top (current);
+ this->pd_root->prefix (current);
+ }
+ else
+ {
+ this->pragma_prefixes_.push (tmp.rep ());
+ this->pd_root->prefix ((char *) tmp.fast_rep ());
+ }
}
UTL_ScopedName *