summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-01-03 20:48:15 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-01-03 20:48:15 +0000
commit667bea8864100e05d334bb5c6821cb8a8256bc19 (patch)
tree4f708912fcf7157495864bf988c608613b64116c
parent4b644b6deef058aee27e9b713495eac884fb101d (diff)
downloadATCD-667bea8864100e05d334bb5c6821cb8a8256bc19.tar.gz
ChangeLogTag: Fri Jan 3 14:43:56 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog11
-rw-r--r--TAO/TAO_IDL/include/idl_global.h5
-rw-r--r--TAO/TAO_IDL/util/utl_global.cpp36
3 files changed, 40 insertions, 12 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 981f8d830f6..1fdb121b288 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,14 @@
+Fri Jan 3 14:43:56 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/util/utl_global.cpp:
+ * TAO_IDL/include/idl_global.h:
+
+ Changes to the management of the IDL compiler's stack of prefixes,
+ to address a problem that appeared when there is a chain of
+ included IDL files. Thanks to Adee Ran <adeeran@yahoo.com> for
+ reporting the problem and supplying example IDL files to
+ reproduce it.
+
Fri Jan 03 14:22:14 2003 Pradeep Gore <pradeep@oomworks.com>
* orbsvcs/Notify_Service/Notify_Server.cpp:
diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h
index 064b731be77..fd2886e5749 100644
--- a/TAO/TAO_IDL/include/idl_global.h
+++ b/TAO/TAO_IDL/include/idl_global.h
@@ -437,7 +437,7 @@ public:
UTL_ScopedName *string_to_scoped_name (char *s);
// Parses a string with double colons.
- long seen_include_file_before(UTL_String *);
+ long seen_include_file_before (char *);
// Seen this include before?
long last_seen_index (void) const;
@@ -523,9 +523,6 @@ private:
ACE_Unbounded_Stack<char *> pragma_prefixes_;
// Container for all the #pragma prefix declarations.
- ACE_Hash_Map_Manager<ACE_CString, ACE_CString, ACE_Null_Mutex> file_prefixes_;
- // Remembers the prefixes associated with files, if any.
-
long last_seen_index_;
// The index (not zero-based!) of the last seen included file.
diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp
index 1d64e2877a4..db3654f073f 100644
--- a/TAO/TAO_IDL/util/utl_global.cpp
+++ b/TAO/TAO_IDL/util/utl_global.cpp
@@ -465,13 +465,22 @@ IDL_GlobalData::set_read_from_stdin (idl_bool r)
// Have we seen this #include file name before?
long
-IDL_GlobalData::seen_include_file_before (UTL_String *n)
+IDL_GlobalData::seen_include_file_before (char *n)
{
unsigned long i;
+ char *incl = 0;
+ char *tmp = n;
+
+ if (n[0] == '.')
+ {
+ tmp = n + 2;
+ }
for (i = 0; i < this->pd_n_include_file_names; ++i)
{
- if (n->compare (this->pd_include_file_names[i]))
+ incl = this->pd_include_file_names[i]->get_string ();
+
+ if (ACE_OS::strcmp (tmp, incl) == 0)
{
// We use the index value in the function below. We
// add 1 so a match on the first try will not return 0.
@@ -489,7 +498,7 @@ IDL_GlobalData::store_include_file_name (UTL_String *n)
UTL_String **o_include_file_names;
unsigned long o_n_alloced_file_names;
unsigned long i;
- long seen = this->seen_include_file_before (n);
+ long seen = this->seen_include_file_before (n->get_string ());
// Check if we need to store it at all or whether we've seen it already.
if (seen)
@@ -954,11 +963,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);
-
- if (ACE_OS::strcmp (fstring, this->pd_main_filename->get_string ()) != 0
- && this->pragma_prefixes_.size () > 1)
+ char *main_filename = this->pd_main_filename->get_string ();
+
+ // The first branch is executed if we are finishing an
+ // included IDL file (but the current filename has not yet
+ // been changed). So we check for (1) the current filename is
+ // not the same as the main filename (2) the prefix stack size
+ // is greater than 1 (to skip the case where we are passed the
+ // temporary filename) and (3) we have either seen the filename
+ // passed in before as an included file or we are passed the
+ // main filename. Otherwise we know we are beginning an included
+ // file, so we push a blank prefix on the stack, which may
+ // possibly be changed later.
+ if (ACE_OS::strcmp (fstring, main_filename) != 0
+ && this->pragma_prefixes_.size () > 1
+ && (this->seen_include_file_before (filename) != 0
+ || ACE_OS::strcmp (filename, main_filename) == 0))
{
char *trash = 0;
this->pragma_prefixes_.pop (trash);