From ecae6d186bf590c2c056e311aeed0219f95c794a Mon Sep 17 00:00:00 2001 From: mcorino Date: Mon, 2 Apr 2007 13:05:21 +0000 Subject: ChangeLogTag: Mon Apr 2 14:06:12 UTC 2007 Martin Corino --- TAO/ChangeLog | 11 +++++++ TAO/TAO_IDL/driver/drv_preproc.cpp | 12 ++++++++ TAO/TAO_IDL/fe/idl.ll | 18 ++++++++++++ TAO/TAO_IDL/fe/lex.yy.cpp | 18 ++++++++++++ TAO/TAO_IDL/include/idl_global.h | 4 +++ TAO/TAO_IDL/util/utl_global.cpp | 59 ++++++-------------------------------- 6 files changed, 71 insertions(+), 51 deletions(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 4d84f365e12..8155d2aea91 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,14 @@ +Mon Apr 2 14:06:12 UTC 2007 Martin Corino + + * TAO_IDL/include/idl_global.h: + * TAO_IDL/fe/lex.yy.cpp: + * TAO_IDL/fe/idl.ll: + * TAO_IDL/driver/drv_preproc.cpp: + * TAO_IDL/util/utl_global.cpp: + + Platform specific changes to make IDL compiler run on both + OpenVMS Alpha and OpenVMS IA64. + Sun Apr 1 04:03:06 UTC 2007 Chad Elliott * tests/Bug_2735_Regression/run_test.pl: diff --git a/TAO/TAO_IDL/driver/drv_preproc.cpp b/TAO/TAO_IDL/driver/drv_preproc.cpp index ad62e10afb8..02872576001 100644 --- a/TAO/TAO_IDL/driver/drv_preproc.cpp +++ b/TAO/TAO_IDL/driver/drv_preproc.cpp @@ -1084,7 +1084,19 @@ DRV_pre_proc (const char *myfile) myfile); ACE_OS::fclose (file); +#if defined (ACE_OPENVMS) + { + char main_abspath[MAXPATHLEN] = ""; + char trans_path[MAXPATHLEN] = ""; + char *main_fullpath = + ACE_OS::realpath (IDL_GlobalData::translateName (myfile, trans_path), + main_abspath); + idl_global->set_main_filename ( + idl_global->utl_string_factory (main_fullpath)); + } +#else idl_global->set_main_filename (idl_global->utl_string_factory (myfile)); +#endif ACE_Auto_String_Free safety (ACE_OS::strdup (myfile)); UTL_String *tmp = diff --git a/TAO/TAO_IDL/fe/idl.ll b/TAO/TAO_IDL/fe/idl.ll index 9f788d54443..34b2c5eafc2 100644 --- a/TAO/TAO_IDL/fe/idl.ll +++ b/TAO/TAO_IDL/fe/idl.ll @@ -456,6 +456,13 @@ idl_parse_line_and_file (char *buf) } h[i] = '\0'; +#if defined (ACE_OPENVMS) + // translate this into *nix format as the OpenVMS preprocessor + // possibly produced VMS-style paths here. + char trans_path[MAXPATHLEN] = ""; + char *temp_h = IDL_GlobalData::translateName (h, trans_path); + if (temp_h) h = temp_h; +#endif ACE_NEW (tmp, UTL_String (h)); idl_global->update_prefix (tmp->get_string ()); @@ -469,7 +476,18 @@ idl_parse_line_and_file (char *buf) if (!is_real_filename) { +#if defined (ACE_OPENVMS) + char full_path[MAXPATHLEN] = ""; + char *full_fname = ACE_OS::realpath (fname->get_string (), full_path); + // I don't see the benefit of using ->compare since this is targeted at IDL identifiers + // not at filenames and in the case of OpenVMS (case-insensitive filesystem) gets really + // problematic as filenames retrieved through different mechanisms may give different + // casing. + is_main_filename = idl_global->path_cmp (idl_global->main_filename ()->get_string (), + full_fname) == 0; +#else is_main_filename = fname->compare (idl_global->main_filename ()); +#endif } if (is_real_filename || is_main_filename) diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp b/TAO/TAO_IDL/fe/lex.yy.cpp index 76378720d17..268becd5a7d 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp +++ b/TAO/TAO_IDL/fe/lex.yy.cpp @@ -2659,6 +2659,13 @@ idl_parse_line_and_file (char *buf) } h[i] = '\0'; +#if defined (ACE_OPENVMS) + // translate this into *nix format as the OpenVMS preprocessor + // possibly produced VMS-style paths here. + char trans_path[MAXPATHLEN] = ""; + char *temp_h = IDL_GlobalData::translateName (h, trans_path); + if (temp_h) h = temp_h; +#endif ACE_NEW (tmp, UTL_String (h)); idl_global->update_prefix (tmp->get_string ()); @@ -2672,7 +2679,18 @@ idl_parse_line_and_file (char *buf) if (!is_real_filename) { +#if defined (ACE_OPENVMS) + char full_path[MAXPATHLEN] = ""; + char *full_fname = ACE_OS::realpath (fname->get_string (), full_path); + // I don't see the benefit of using ->compare since this is targeted at IDL identifiers + // not at filenames and in the case of OpenVMS (case-insensitive filesystem) gets really + // problematic as filenames retrieved through different mechanisms may give different + // casing. + is_main_filename = idl_global->path_cmp (idl_global->main_filename ()->get_string (), + full_fname) == 0; +#else is_main_filename = fname->compare (idl_global->main_filename ()); +#endif } if (is_real_filename || is_main_filename) diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h index c56231eb1c2..75f9531c06b 100644 --- a/TAO/TAO_IDL/include/idl_global.h +++ b/TAO/TAO_IDL/include/idl_global.h @@ -599,6 +599,10 @@ public: UTL_String *utl_string_factory (const char *str); // Utility function to create UTL_String classes on the FE heap. +#if defined (ACE_OPENVMS) + static char* translateName(const char* name, char *name_buf); +#endif + private: // Data UTL_ScopeStack pd_scopes; // Store scopes stack diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index 017a5372ae1..882bc56a0b3 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -93,12 +93,17 @@ ACE_RCSID (util, static long *pSeenOnce= 0; -#if defined(ACE_OPENVMS) +#if defined (ACE_OPENVMS) #include -static char* translateName(const char* name) +char* IDL_GlobalData::translateName(const char* name, char *name_buf) { - char* transName = (ACE_OS::strchr (name, '[') == 0 + char* transName = (ACE_OS::strpbrk (name, ":[") == 0 ? (char*)name : ::decc$translate_vms (name)); + if (transName) + { + ACE_OS::strcpy (name_buf, transName); + transName = name_buf; + } return (transName == 0 || ((int)transName) == -1 ) ? 0 : transName; } #endif @@ -390,7 +395,6 @@ IDL_GlobalData::set_main_filename (UTL_String *n) delete this->pd_main_filename; this->pd_main_filename = 0; } - this->pd_main_filename = n; } @@ -734,24 +738,15 @@ IDL_GlobalData::validate_included_idl_files (void) // Check this name with the names list that we got from the // preprocessor. size_t valid_file = 0; -#if defined (ACE_OPENVMS) - full_path = ACE_OS::realpath (translateName (pre_preproc_includes[j]), - pre_abspath); -#else full_path = ACE_OS::realpath (pre_preproc_includes[j], pre_abspath); -#endif if (full_path != 0) { for (size_t ni = 0; ni < n_post_preproc_includes; ++ni) { post_tmp = post_preproc_includes[ni]->get_string (); -#if defined (ACE_OPENVMS) - full_path = ACE_OS::realpath (translateName (post_tmp), post_abspath); -#else full_path = ACE_OS::realpath (post_tmp, post_abspath); -#endif if (full_path != 0 && this->path_cmp (pre_abspath, post_abspath) == 0) { @@ -793,24 +788,15 @@ IDL_GlobalData::validate_included_idl_files (void) pre_partial += ACE_DIRECTORY_SEPARATOR_STR; pre_partial += pre_preproc_includes[j]; -#if defined (ACE_OPENVMS) - full_path = - ACE_OS::realpath (translateName (pre_partial.c_str ()), pre_abspath); -#else full_path = ACE_OS::realpath (pre_partial.c_str (), pre_abspath); -#endif if (full_path != 0) { for (size_t m = 0; m < n_post_preproc_includes; ++m) { post_tmp = post_preproc_includes[m]->get_string (); -#if defined (ACE_OPENVMS) - full_path = ACE_OS::realpath (translateName (post_tmp), post_abspath); -#else full_path = ACE_OS::realpath (post_tmp, post_abspath); -#endif if (full_path != 0 && this->path_cmp (pre_abspath, post_abspath) == 0) @@ -1328,35 +1314,6 @@ IDL_GlobalData::stripped_preproc_include (const char *name) } } -#if defined(ACE_OPENVMS) - char* tmp; - char* tmpName = new char[strlen(name) + 1]; - ACE_OS::strcpy (tmpName, name); - if ((tmp = ACE_OS::strrchr (tmpName, ';')) != 0) - *tmp = '\000'; - if ((tmp = translateName (tmpName)) != 0) - name = tmp; - delete [] tmpName; - - char home[PATH_MAX]; - if (ACE_OS::getcwd (home, sizeof(home)) != NULL) - { - tmp = translateName (home); - if (tmp == 0) - tmp = home; - if (ACE_OS::strlen (tmp) < ACE_OS::strlen (name)) - { - if (ACE_OS::strncasecmp (tmp, name, ACE_OS::strlen (tmp)) == 0) - { - const char* tmpC = name + ACE_OS::strlen (tmp); - if (*tmpC == '/') - ++tmpC; - return (char*)tmpC; - } - } - } -#endif - return name; } -- cgit v1.2.1