diff options
41 files changed, 242 insertions, 312 deletions
diff --git a/.github/workflows/face.yml b/.github/workflows/face.yml index 5e244a5a409..5c029196cec 100644 --- a/.github/workflows/face.yml +++ b/.github/workflows/face.yml @@ -24,7 +24,7 @@ jobs: CXX: g++-10 PackageDeps: g++-10 platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU - os: ubuntu-18.04 + os: ubuntu-20.04 runs-on: ${{ matrix.os }} name: ${{ matrix.os }} ${{ matrix.CXX }} ${{ matrix.feature }} env: diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4f3b2fb4638..310922433cd 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -38,23 +38,23 @@ jobs: CXX: g++-7 PackageDeps: g++-7 platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU - os: ubuntu-18.04 + os: ubuntu-20.04 CheckPkgConfig: 1 - CC: gcc-8 CXX: g++-8 PackageDeps: g++-8 platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU - os: ubuntu-18.04 + os: ubuntu-20.04 - CC: gcc-9 CXX: g++-9 PackageDeps: g++-9 platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU - os: ubuntu-18.04 + os: ubuntu-20.04 - CC: gcc-10 CXX: g++-10 PackageDeps: g++-10 platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU - os: ubuntu-18.04 + os: ubuntu-20.04 - CC: gcc-11 CXX: g++-11 PackageDeps: g++-11 @@ -76,23 +76,23 @@ jobs: CXX: clang++-6.0 PackageDeps: clang-6.0 platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU - os: ubuntu-18.04 + os: ubuntu-20.04 - CC: clang-7 CXX: clang++-7 PackageDeps: clang-7 platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU - os: ubuntu-18.04 + os: ubuntu-20.04 - CC: clang-8 CXX: clang++-8 PackageDeps: clang-8 platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU - os: ubuntu-18.04 + os: ubuntu-20.04 - CC: clang-9 CXX: clang++-9 PackageDeps: clang-9 Repo: llvm-toolchain-$(lsb_release -cs)-9 platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU - os: ubuntu-18.04 + os: ubuntu-20.04 - CC: clang-10 CXX: clang++-10 PackageDeps: clang-10 @@ -123,12 +123,18 @@ jobs: Repo: llvm-toolchain-$(lsb_release -cs)-14 platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU os: ubuntu-22.04 + - CC: clang-15 + CXX: clang++-15 + PackageDeps: clang-15 + Repo: llvm-toolchain-$(lsb_release -cs)-15 + platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU + os: ubuntu-22.04 - feature: CORBA/e micro CC: gcc-10 CXX: g++-10 PackageDeps: g++-10 platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU - os: ubuntu-18.04 + os: ubuntu-20.04 optional_feature: corba_e_micro=1 optional_macros: corba_e_micro=1 - feature: CORBA/e compact @@ -136,7 +142,7 @@ jobs: CXX: g++-10 PackageDeps: g++-10 platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU - os: ubuntu-18.04 + os: ubuntu-20.04 optional_feature: corba_e_compact=1 optional_macros: corba_e_compact=1 - feature: ACE for TAO diff --git a/ACE/ace/ACE.cpp b/ACE/ace/ACE.cpp index 231a7a2dc72..2376de0f58d 100644 --- a/ACE/ace/ACE.cpp +++ b/ACE/ace/ACE.cpp @@ -2342,11 +2342,7 @@ ACE::format_hexdump (const char *buffer, textver[j] = 0; ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start), -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_TEXT (" %ls\n"), -#else - ACE_TEXT (" %s\n"), -#endif + ACE_TEXT (" %") ACE_TEXT_PRIs ACE_TEXT ("\n"), textver); while (*obuf != '\0') @@ -2383,11 +2379,7 @@ ACE::format_hexdump (const char *buffer, textver[i] = 0; ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start), -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_TEXT (" %ls\n"), -#else - ACE_TEXT (" %s\n"), -#endif + ACE_TEXT (" %") ACE_TEXT_PRIs ACE_TEXT ("\n"), textver); } return size; diff --git a/ACE/ace/INET_Addr.cpp b/ACE/ace/INET_Addr.cpp index 9ba557bb94d..58140d71ad4 100644 --- a/ACE/ace/INET_Addr.cpp +++ b/ACE/ace/INET_Addr.cpp @@ -49,20 +49,12 @@ ACE_INET_Addr::addr_to_string (ACE_TCHAR s[], + 5 // ACE_OS::strlen ("65535"), Assuming the max port number. + 1 // sizeof (':'), addr/port sep + 1; // sizeof ('\0'), terminating NUL -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_TCHAR const *format = ACE_TEXT("%ls:%d"); -#else - ACE_TCHAR const *format = ACE_TEXT("%s:%d"); -#endif /* !ACE_WIN32 && ACE_USES_WCHAR */ + ACE_TCHAR const *format = ACE_TEXT("%") ACE_TEXT_PRIs ACE_TEXT(":%d"); #if defined (ACE_HAS_IPV6) if (ACE_OS::strchr (hoststr, ACE_TEXT (':')) != 0) { total_len += 2; // ACE_OS::strlen ("[]") IPv6 addr frames -# if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - format = ACE_TEXT("[%ls]:%d"); -# else - format = ACE_TEXT("[%s]:%d"); -# endif /* !ACE_WIN32 && ACE_USES_WCHAR */ + format = ACE_TEXT("[%") ACE_TEXT_PRIs ACE_TEXT("]:%d"); } #endif // ACE_HAS_IPV6 diff --git a/ACE/ace/Log_Msg.cpp b/ACE/ace/Log_Msg.cpp index c49c319f759..88f584c2ed1 100644 --- a/ACE/ace/Log_Msg.cpp +++ b/ACE/ace/Log_Msg.cpp @@ -1232,11 +1232,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, break; case 'N': // Source file name -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif + ACE_OS::strcpy (fp, ACE_TEXT_PRIs); if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, this->file () ? @@ -1251,11 +1247,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, break; case 'n': // Program name -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else /* ACE_WIN32 && ACE_USES_WCHAR */ - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif + ACE_OS::strcpy (fp, ACE_TEXT_PRIs); if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, ACE_Log_Msg::program_name_ ? @@ -1495,11 +1487,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, { // Nope, print out standard priority_name() string -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif + ACE_OS::strcpy (fp, ACE_TEXT_PRIs); if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, @@ -1529,11 +1517,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, { #endif -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else /* ACE_WIN32 && ACE_USES_WCHAR */ - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif + ACE_OS::strcpy (fp, ACE_TEXT_PRIs); if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, ACE_TEXT_CHAR_TO_TCHAR (msg)); @@ -1713,11 +1697,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, sizeof (day_and_time) / sizeof (ACE_TCHAR), true); } -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif + ACE_OS::strcpy (fp, ACE_TEXT_PRIs); if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, day_and_time); @@ -1731,11 +1711,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, // hour:minute:sec.usec format. { ACE_TCHAR day_and_time[27]; -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); -#else - ACE_OS::strcpy (fp, ACE_TEXT ("s")); -#endif + ACE_OS::strcpy (fp, ACE_TEXT_PRIs); // Did we find the flag indicating a time value argument if (format[1] == ACE_TEXT('#')) { @@ -1810,11 +1786,10 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, { #if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) wchar_t *str = va_arg (argp, wchar_t *); - ACE_OS::strcpy (fp, ACE_TEXT ("ls")); #else /* ACE_WIN32 && ACE_USES_WCHAR */ ACE_TCHAR *str = va_arg (argp, ACE_TCHAR *); - ACE_OS::strcpy (fp, ACE_TEXT ("s")); #endif /* ACE_WIN32 && ACE_USES_WCHAR */ + ACE_OS::strcpy (fp, ACE_TEXT_PRIs); if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, str ? str : ACE_TEXT ("(null)")); @@ -2968,11 +2943,7 @@ ACE_Log_Msg::log_hexdump (ACE_Log_Priority log_priority, if (text) wr_ptr += ACE_OS::snprintf (wr_ptr, end_ptr - wr_ptr, -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_TEXT ("%ls - "), -#else - ACE_TEXT ("%s - "), -#endif + ACE_TEXT ("%") ACE_TEXT_PRIs ACE_TEXT (" - "), text); wr_ptr += ACE_OS::snprintf (wr_ptr, diff --git a/ACE/ace/Log_Record.cpp b/ACE/ace/Log_Record.cpp index a97d63e023c..ea4a782ffd6 100644 --- a/ACE/ace/Log_Record.cpp +++ b/ACE/ace/Log_Record.cpp @@ -235,16 +235,6 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[], /* yyyy-mm-dd hh:mm:ss.mmmmmm<nul> */ ACE_TCHAR timestamp[27]; // Only used by VERBOSE and VERBOSE_LITE. - // The sprintf format needs to be different for Windows and POSIX - // in the wide-char case. -#if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) - const ACE_TCHAR *verbose_fmt = ACE_TEXT ("%s@%s@%u@%s@%s"); - const ACE_TCHAR *verbose_lite_fmt = ACE_TEXT ("%s@%s@%s"); -#else - const ACE_TCHAR *verbose_fmt = ACE_TEXT ("%ls@%ls@%u@%ls@%ls"); - const ACE_TCHAR *verbose_lite_fmt = ACE_TEXT ("%ls@%ls@%ls"); -#endif - if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE) || ACE_BIT_ENABLED (verbose_flag, @@ -269,7 +259,10 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[], ? ACE_TEXT ("<local_host>") : host_name); ACE_OS::snprintf (verbose_msg, verbose_msg_size, - verbose_fmt, + ACE_TEXT ("%") ACE_TEXT_PRIs + ACE_TEXT ("@%") ACE_TEXT_PRIs + ACE_TEXT ("@%u@%") ACE_TEXT_PRIs + ACE_TEXT ("@%") ACE_TEXT_PRIs, timestamp, lhost_name, this->pid_, @@ -278,7 +271,9 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[], } else if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE_LITE)) ACE_OS::snprintf (verbose_msg, verbose_msg_size, - verbose_lite_fmt, + ACE_TEXT ("%") ACE_TEXT_PRIs + ACE_TEXT ("@%") ACE_TEXT_PRIs + ACE_TEXT ("@%") ACE_TEXT_PRIs, timestamp, ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)), this->msg_data_); @@ -318,15 +313,9 @@ ACE_Log_Record::print (const ACE_TCHAR host_name[], { int const verbose_msg_len = static_cast<int> (ACE_OS::strlen (verbose_msg)); -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - int const fwrite_result = ACE_OS::fprintf (fp, - ACE_TEXT ("%ls"), - verbose_msg); -#else int const fwrite_result = ACE_OS::fprintf (fp, - ACE_TEXT ("%s"), + ACE_TEXT ("%") ACE_TEXT_PRIs, verbose_msg); -#endif // We should have written everything if (fwrite_result != verbose_msg_len) result = -1; diff --git a/ACE/ace/Process.cpp b/ACE/ace/Process.cpp index 9459e3dbb3f..eb1f5f6a31b 100644 --- a/ACE/ace/Process.cpp +++ b/ACE/ace/Process.cpp @@ -1041,14 +1041,9 @@ ACE_Process_Options::setenv (const ACE_TCHAR *variable_name, ACE_NEW_RETURN (newformat, ACE_TCHAR[buflen], -1); std::unique_ptr<ACE_TCHAR[]> safe_newformat (newformat); -# if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - const ACE_TCHAR *fmt = ACE_TEXT ("%ls=%ls"); -# else - const ACE_TCHAR *fmt = ACE_TEXT ("%s=%s"); -# endif - // Add in the variable name. - ACE_OS::snprintf (safe_newformat.get (), buflen, fmt, + ACE_OS::snprintf (safe_newformat.get (), buflen, + ACE_TEXT ("%") ACE_TEXT_PRIs ACE_TEXT ("=%") ACE_TEXT_PRIs, variable_name, format); // Add the rest of the varargs. diff --git a/ACE/ace/ace_wchar.h b/ACE/ace/ace_wchar.h index 832e43ea8db..980d03f0728 100644 --- a/ACE/ace/ace_wchar.h +++ b/ACE/ace/ace_wchar.h @@ -91,6 +91,11 @@ typedef char ACE_ANTI_TCHAR; # define ACE_TEXT_CHAR_TO_TCHAR(STRING) ACE_Ascii_To_Wide (STRING).wchar_rep () # define ACE_TEXT_WCHAR_TO_TCHAR(STRING) STRING # define ACE_TEXT_ANTI_TO_TCHAR(STRING) ACE_Ascii_To_Wide (STRING).wchar_rep () +# if !defined (ACE_WIN32) +# define ACE_TEXT_PRIs ACE_TEXT("ls") +# else +# define ACE_TEXT_PRIs ACE_TEXT("s") +# endif #else /* ACE_USES_WCHAR */ typedef char ACE_TCHAR; typedef wchar_t ACE_ANTI_TCHAR; @@ -100,6 +105,7 @@ typedef wchar_t ACE_ANTI_TCHAR; # define ACE_TEXT_CHAR_TO_TCHAR(STRING) STRING # define ACE_TEXT_WCHAR_TO_TCHAR(STRING) ACE_Wide_To_Ascii (STRING).char_rep () # define ACE_TEXT_ANTI_TO_TCHAR(STRING) ACE_Wide_To_Ascii (STRING).char_rep () +# define ACE_TEXT_PRIs ACE_TEXT("s") #endif /* ACE_USES_WCHAR */ // The OS_String module defines some wide-char functions that are not diff --git a/ACE/docs/ACE-guidelines.html b/ACE/docs/ACE-guidelines.html index 943b0191022..ab270f13aa8 100644 --- a/ACE/docs/ACE-guidelines.html +++ b/ACE/docs/ACE-guidelines.html @@ -809,6 +809,14 @@ Foo::bar () <li>Do not use the Win32 <code>TCHAR</code> macros. The wide character-ness of ACE is separate from UNICODE and _UNICODE. + <li>If you have a <code>printf</code>-like format specifier that + uses <code>%s</code> to format a string, certain WCHAR implementations + require <code>%ls</code> instead. + The macro <code>ACE_TEXT_PRIs</code> contains <code>"s"</code> or <code>"ls"</code> + depending upon the WCHAR implementation, and may be used as + <code>ACE_TEXT("%") ACE_TEXT_PRI_s</code>, where the first argument may also + contain flags and width specifiers. + <li>For TAO, don't use <code>ACE_TCHAR</code> or <code>ACE_TEXT</code>. The CORBA specification defines APIs as using char. So most of the time there is no need to use wide characters. diff --git a/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp b/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp index 8cee2fd5b37..defe6108f7e 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp @@ -124,11 +124,6 @@ Consumer_Router::put (ACE_Message_Block *mb, } // Return information about the <Consumer_Router>. -#if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) -# define FMTSTR ACE_TEXT ("%s\t %d/%s %s (%s)\n") -#else -# define FMTSTR ACE_TEXT ("%ls\t %d/%ls %ls (%ls)\n") -#endif /* ACE_WIN32 || !ACE_USES_WCHAR */ int Consumer_Router::info (ACE_TCHAR **strp, size_t length) const @@ -141,7 +136,11 @@ Consumer_Router::info (ACE_TCHAR **strp, size_t length) const return -1; ACE_OS::sprintf (buf, - FMTSTR, + ACE_TEXT ("%") ACE_TEXT_PRIs + ACE_TEXT ("\t %d/%") ACE_TEXT_PRIs + ACE_TEXT (" %") ACE_TEXT_PRIs + ACE_TEXT (" (%") ACE_TEXT_PRIs + ACE_TEXT (")\n"), module_name, addr.get_port_number (), ACE_TEXT ("tcp"), diff --git a/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp b/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp index 485e1e1eb60..2f9184f12b2 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp @@ -130,11 +130,6 @@ Supplier_Router::put (ACE_Message_Block *mb, } // Return information about the <Supplier_Router>. -#if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) -# define FMTSTR ACE_TEXT ("%s\t %d/%s %s (%s)\n") -#else -# define FMTSTR ACE_TEXT ("%ls\t %d/%ls %ls (%ls)\n") -#endif /* ACE_WIN32 || !ACE_USES_WCHAR */ int Supplier_Router::info (ACE_TCHAR **strp, size_t length) const @@ -147,7 +142,11 @@ Supplier_Router::info (ACE_TCHAR **strp, size_t length) const return -1; ACE_OS::sprintf (buf, - FMTSTR, + ACE_TEXT ("%") ACE_TEXT_PRIs + ACE_TEXT ("\t %d/%") ACE_TEXT_PRIs + ACE_TEXT (" %") ACE_TEXT_PRIs + ACE_TEXT (" (%") ACE_TEXT_PRIs + ACE_TEXT (")\n"), module_name, addr.get_port_number (), ACE_TEXT ("tcp"), diff --git a/ACE/examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp b/ACE/examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp index 9cd53b32811..14f92f99282 100644 --- a/ACE/examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp +++ b/ACE/examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp @@ -116,13 +116,10 @@ Consumer_Router::info (ACE_TCHAR **strp, size_t length) const if (sa.get_local_addr (addr) == -1) return -1; -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) -# define FMTSTR ACE_TEXT ("%ls\t %ls/ %ls") -#else -# define FMTSTR ACE_TEXT ("%s\t %s/ %s") -#endif - - ACE_OS::sprintf (buf, FMTSTR, + ACE_OS::sprintf (buf, + ACE_TEXT ("%") ACE_TEXT_PRIs + ACE_TEXT ("\t %") ACE_TEXT_PRIs + ACE_TEXT ("/ %") ACE_TEXT_PRIs, module_name, ACE_TEXT ("upipe"), ACE_TEXT ("# consumer router\n")); diff --git a/ACE/examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp b/ACE/examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp index 4f039b6ab93..24b880893ae 100644 --- a/ACE/examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp +++ b/ACE/examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp @@ -115,13 +115,10 @@ Supplier_Router::info (ACE_TCHAR **strp, size_t length) const if (sa.get_local_addr (addr) == -1) return -1; -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) -# define FMTSTR ACE_TEXT ("%ls\t %ls/ %ls") -#else -# define FMTSTR ACE_TEXT ("%s\t %s/ %s") -#endif - - ACE_OS::sprintf (buf, FMTSTR, + ACE_OS::sprintf (buf, + ACE_TEXT ("%") ACE_TEXT_PRIs + ACE_TEXT ("\t %") ACE_TEXT_PRIs + ACE_TEXT ("/ %") ACE_TEXT_PRIs, module_name, ACE_TEXT ("upipe"), ACE_TEXT ("# supplier router\n")); diff --git a/ACE/examples/OS/Process/process.cpp b/ACE/examples/OS/Process/process.cpp index fb97a2c09e7..87e8e53f29e 100644 --- a/ACE/examples/OS/Process/process.cpp +++ b/ACE/examples/OS/Process/process.cpp @@ -180,11 +180,7 @@ static void test_ls () { ACE_Process_Options options; -#if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) - options.command_line (ACE_TEXT ("%s -al"), LS_PATH); -#else - options.command_line (ACE_TEXT ("%ls -al"), LS_PATH); -#endif + options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs ACE_TEXT (" -al"), LS_PATH); ACE_Process new_process; if (new_process.spawn (options) == -1) { @@ -206,11 +202,7 @@ static void test_wait () { ACE_Process_Options options; -#if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) - options.command_line (ACE_TEXT ("%s 10"), SLEEP_PATH); -#else - options.command_line (ACE_TEXT ("%ls 10"), SLEEP_PATH); -#endif + options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs ACE_TEXT (" 10"), SLEEP_PATH); ACE_Process process1; if (process1.spawn (options) == -1) { @@ -465,11 +457,7 @@ test_setenv (const ACE_TCHAR *argv0) options.setenv (ACE_TEXT ("ACE_PROCESS_TEST= here's a large number %u"), 0 - 1); options.setenv (ACE_TEXT ("ACE_PROCESS_TEST2"), ACE_TEXT ("ophilli")); -#if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) - options.command_line ("%s -g", argv0); -#else - options.command_line ("%ls -g", argv0); -#endif + options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs ACE_TEXT (" -g", argv0); ACE_Process process; if (process.spawn (options) == -1) { @@ -521,13 +509,8 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) if (run_all) { -#if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) - const ACE_TCHAR *cmdline = ACE_TEXT ("%s -d -l -s -w"); -#else - const ACE_TCHAR *cmdline = ACE_TEXT ("%ls -d -l -s -w"); -#endif ACE_Process_Options options; - options.command_line (cmdline, argv[0]); + options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs ACE_TEXT (" -d -l -s -w"), argv[0]); ACE_Process process; if (process.spawn (options) == -1) ACE_ERROR_RETURN ((LM_ERROR, diff --git a/ACE/tests/MEM_Stream_Test.cpp b/ACE/tests/MEM_Stream_Test.cpp index 8cc11482e4a..56e7d629cd6 100644 --- a/ACE/tests/MEM_Stream_Test.cpp +++ b/ACE/tests/MEM_Stream_Test.cpp @@ -281,12 +281,7 @@ test_reactive (const ACE_TCHAR *prog, ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("spawn_n ()"))); #else ACE_Process_Options opts; -# if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) - const ACE_TCHAR *cmdline_fmt = ACE_TEXT ("%s -p%d -r"); -# else - const ACE_TCHAR *cmdline_fmt = ACE_TEXT ("%ls -p%d -r"); -# endif /* ACE_WIN32 || !ACE_USES_WCHAR */ - opts.command_line (cmdline_fmt, prog, sport); + opts.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs ACE_TEXT (" -p%d -r"), prog, sport); if (ACE_Process_Manager::instance ()->spawn_n (NUMBER_OF_REACTIVE_CONNECTIONS, opts) == -1) ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("spawn_n ()"))); @@ -372,12 +367,7 @@ test_concurrent (const ACE_TCHAR *prog, ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("spawn_n()"))); #else ACE_Process_Options opts; -# if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) - const ACE_TCHAR *cmdline_fmt = ACE_TEXT ("%s -p%d -m"); -# else - const ACE_TCHAR *cmdline_fmt = ACE_TEXT ("%ls -p%d -m"); -# endif /* ACE_WIN32 || !ACE_USES_WCHAR */ - opts.command_line (cmdline_fmt, prog, sport); + opts.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs ACE_TEXT (" -p%d -m"), prog, sport); if (ACE_Process_Manager::instance ()->spawn_n (NUMBER_OF_MT_CONNECTIONS, opts) == -1) ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("spawn_n()"))); diff --git a/ACE/tests/Malloc_Test.cpp b/ACE/tests/Malloc_Test.cpp index 8c7161e9342..97c419fcfbe 100644 --- a/ACE/tests/Malloc_Test.cpp +++ b/ACE/tests/Malloc_Test.cpp @@ -357,12 +357,10 @@ run_main (int argc, ACE_TCHAR *argv[]) // No arguments means we're the parent process. ACE_Process_Options options (1); -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - static const ACE_TCHAR* format = ACE_TEXT ("%ls%ls%ls"); -#else - static const ACE_TCHAR* format = ACE_TEXT ("%s%s%s"); -#endif /* !ACE_WIN32 && ACE_USES_WCHAR */ - options.command_line (format, EXE_LOCATION, + options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs + ACE_TEXT ("%") ACE_TEXT_PRIs + ACE_TEXT ("%") ACE_TEXT_PRIs, + EXE_LOCATION, argc > 0 ? argv[0] : ACE_TEXT ("Malloc_Test"), ACE_TEXT (" run_as_test")); diff --git a/ACE/tests/Naming_Test.cpp b/ACE/tests/Naming_Test.cpp index 04f183c738c..a593c0adb3c 100644 --- a/ACE/tests/Naming_Test.cpp +++ b/ACE/tests/Naming_Test.cpp @@ -257,11 +257,7 @@ run_main (int argc, ACE_TCHAR *argv[]) } // Set the database name using the pid. mktemp isn't always available. ACE_OS::snprintf(temp_file, BUFSIZ, -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_TEXT ("%ls%d"), -#else - ACE_TEXT ("%s%d"), -#endif + ACE_TEXT ("%") ACE_TEXT_PRIs ACE_TEXT ("%d"), pname, (int)ACE_OS::getpid ()); diff --git a/ACE/tests/Pipe_Test.cpp b/ACE/tests/Pipe_Test.cpp index 9b1a1120d4a..5cb4b10e1b4 100644 --- a/ACE/tests/Pipe_Test.cpp +++ b/ACE/tests/Pipe_Test.cpp @@ -113,14 +113,10 @@ run_main (int argc, ACE_TCHAR *argv[]) ACE_START_TEST (ACE_TEXT("Pipe_Test")); ACE_INIT_LOG (ACE_TEXT("Pipe_Test-children")); -# if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) - const ACE_TCHAR *cmdline_fmt = ACE_TEXT ("%s -c%s"); -# else - const ACE_TCHAR *cmdline_fmt = ACE_TEXT ("%ls -c%ls"); -# endif /* ACE_WIN32 || !ACE_USES_WCHAR */ ACE_Process_Options options; # ifndef ACE_LACKS_VA_FUNCTIONS - options.command_line (cmdline_fmt, + options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs + ACE_TEXT (" -c%") ACE_TEXT_PRIs, argc > 0 ? argv[0] : ACE_TEXT ("Pipe_Test"), close_pipe == 0 ? ACE_TEXT (" -d") : ACE_TEXT ("")); # else diff --git a/ACE/tests/Process_Manager_Test.cpp b/ACE/tests/Process_Manager_Test.cpp index d5bd07b5536..7464ffded68 100644 --- a/ACE/tests/Process_Manager_Test.cpp +++ b/ACE/tests/Process_Manager_Test.cpp @@ -240,7 +240,7 @@ command_line_test () ACE_Process_Options options (1, command_len + 1); #ifndef ACE_LACKS_VA_FUNCTIONS - options.command_line (command); + options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs, command); #endif ACE_TCHAR * const *procargv = options.command_line_argv (); diff --git a/ACE/tests/Process_Mutex_Test.cpp b/ACE/tests/Process_Mutex_Test.cpp index 5d35c51bb7a..cc522300d54 100644 --- a/ACE/tests/Process_Mutex_Test.cpp +++ b/ACE/tests/Process_Mutex_Test.cpp @@ -146,18 +146,14 @@ run_main (int argc, ACE_TCHAR *argv[]) ACE_Process_Mutex mutex( mutex_name ); # endif -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - static const ACE_TCHAR* format = ACE_TEXT ("%ls -c -n %ls%ls"); -#else - static const ACE_TCHAR* format = ACE_TEXT ("%s -c -n %s%s"); -#endif /* !ACE_WIN32 && ACE_USES_WCHAR */ ACE_Process_Options options; #ifndef ACE_LACKS_VA_FUNCTIONS - options.command_line (format, argc > 0 ? argv[0] : ACE_TEXT ("Process_Mutex_Test"), mutex_name, + options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs + ACE_TEXT (" -c -n %") ACE_TEXT_PRIs + ACE_TEXT ("%") ACE_TEXT_PRIs, + argc > 0 ? argv[0] : ACE_TEXT ("Process_Mutex_Test"), mutex_name, release_mutex == 0 ? ACE_TEXT (" -d") : ACE_TEXT ("")); -#else - ACE_UNUSED_ARG (format); #endif #ifdef ACE_HAS_PROCESS_SPAWN diff --git a/ACE/tests/Process_Test.cpp b/ACE/tests/Process_Test.cpp index d18a5265af8..3cfc9def393 100644 --- a/ACE/tests/Process_Test.cpp +++ b/ACE/tests/Process_Test.cpp @@ -34,13 +34,7 @@ test_setenv () ACE_OS::strcat (bigval, ACE_TEXT ("01234567890123456789012345678901234567890123456789")); #ifndef ACE_LACKS_VA_FUNCTIONS -# if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - const ACE_TCHAR *fmt = ACE_TEXT ("%ls"); -# else - const ACE_TCHAR *fmt = ACE_TEXT ("%s"); -# endif - - if (0 != opts.setenv (ACE_TEXT ("A"), fmt, bigval)) + if (0 != opts.setenv (ACE_TEXT ("A"), ACE_TEXT ("%") ACE_TEXT_PRIs, bigval)) { status = errno; ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("setenv"))); diff --git a/ACE/tests/RW_Process_Mutex_Test.cpp b/ACE/tests/RW_Process_Mutex_Test.cpp index 0b057803db9..88781945c2f 100644 --- a/ACE/tests/RW_Process_Mutex_Test.cpp +++ b/ACE/tests/RW_Process_Mutex_Test.cpp @@ -430,11 +430,6 @@ run_main (int argc, ACE_TCHAR *argv[]) mutex_name.c_str (), ACE_TEXT ("ctor"))); } -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - static const ACE_TCHAR* format = ACE_TEXT ("%ls -c %d -p %u -n %ls"); -#else - static const ACE_TCHAR* format = ACE_TEXT ("%s -c %d -p %u -n %s"); -#endif /* !ACE_WIN32 && ACE_USES_WCHAR */ // The parent process reads time ranges sent from the children via // UDP. Grab an unused UDP port to tell the children to send to. @@ -461,13 +456,12 @@ run_main (int argc, ACE_TCHAR *argv[]) Child *child = (i == 0 ? &writer : &readers[i-1]); ACE_Process_Options options; #ifndef ACE_LACKS_VA_FUNCTIONS - options.command_line (format, + options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs + ACE_TEXT (" -c %d -p %u -n %") ACE_TEXT_PRIs, argc > 0 ? argv[0] : ACE_TEXT ("RW_Process_Mutex_Test"), i, (unsigned int)me.get_port_number (), mutex_name.c_str ()); -#else - ACE_UNUSED_ARG (format); #endif if (child->spawn (options) == -1) { diff --git a/ACE/tests/Time_Service_Test.cpp b/ACE/tests/Time_Service_Test.cpp index f8350526b36..295d784f5f9 100644 --- a/ACE/tests/Time_Service_Test.cpp +++ b/ACE/tests/Time_Service_Test.cpp @@ -65,7 +65,7 @@ run_main (int, ACE_TCHAR *[]) const ACE_TCHAR *server_cl = APPLICATION ACE_TEXT ("server.conf"); ACE_Process_Options server_options; #ifndef ACE_LACKS_VA_FUNCTIONS - server_options.command_line (server_cl); + server_options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs, server_cl); #endif ACE_Process server; @@ -85,7 +85,7 @@ run_main (int, ACE_TCHAR *[]) const ACE_TCHAR *clerk_cl = APPLICATION ACE_TEXT ("clerk.conf"); ACE_Process_Options clerk_options; #ifndef ACE_LACKS_VA_FUNCTIONS - clerk_options.command_line (clerk_cl); + clerk_options.command_line (ACE_TEXT ("%") ACE_TEXT_PRIs, clerk_cl); #endif ACE_Process clerk; diff --git a/ACE/tests/test_config.h b/ACE/tests/test_config.h index f9e845d5ac7..82b7059ab75 100644 --- a/ACE/tests/test_config.h +++ b/ACE/tests/test_config.h @@ -149,14 +149,12 @@ size_t const ACE_MAX_THREADS = 4; } #else /* ! VXWORKS */ -# if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) -# define ACE_INIT_LOG_FMT ACE_TEXT ("%ls%ls%ls") -# else -# define ACE_INIT_LOG_FMT ACE_TEXT ("%s%s%s") -# endif /* !ACE_WIN32 && ACE_USES_WCHAR */ #define ACE_INIT_LOG(NAME) \ ACE_TCHAR temp[MAXPATHLEN]; \ - ACE_OS::sprintf (temp, ACE_INIT_LOG_FMT, \ + ACE_OS::sprintf (temp, \ + ACE_TEXT ("%") ACE_TEXT_PRIs \ + ACE_TEXT ("%") ACE_TEXT_PRIs \ + ACE_TEXT ("%") ACE_TEXT_PRIs, \ ACE_LOG_DIRECTORY, \ ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR), \ ACE_LOG_FILE_EXT_NAME); \ diff --git a/ACE/websvcs/lib/URL_Addr.cpp b/ACE/websvcs/lib/URL_Addr.cpp index 5e5a02c9b1f..42d1e5a0827 100644 --- a/ACE/websvcs/lib/URL_Addr.cpp +++ b/ACE/websvcs/lib/URL_Addr.cpp @@ -41,16 +41,6 @@ static size_t tn3270_size = sizeof(tn3270)/sizeof(tn3270[0]) - 1; static ACE_TCHAR gopher[] = ACE_TEXT ("gopher:"); static size_t gopher_size = sizeof(gopher)/sizeof(gopher[0]) - 1; -// When assembling URLs, sprintf() is often used. The format specifier for -// a string changes depending on the platform and char width being fed to it. -// Since we use ACE_TCHAR for strings, and it changes with the char width, -// the printf specifier needs to change with the platform. -#if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) -# define ACE_PRINTF_S ACE_TEXT ("%s") -#else -# define ACE_PRINTF_S ACE_TEXT ("%ls") -#endif - ACE_URL_Addr::ACE_URL_Addr () : url_ (0) { @@ -531,11 +521,11 @@ ACE_HTTP_Addr::addr_to_string (ACE_TCHAR *buffer, if (flags == 0) { ACE_INET_Addr inet = this->get_inet_address (); - n += ACE_OS::sprintf (buffer + n, ACE_PRINTF_S, inet.get_host_addr ()); + n += ACE_OS::sprintf (buffer + n, ACE_TEXT ("%") ACE_TEXT_PRIs, inet.get_host_addr ()); } else { - n += ACE_OS::sprintf (buffer + n, ACE_PRINTF_S, this->hostname_); + n += ACE_OS::sprintf (buffer + n, ACE_TEXT ("%") ACE_TEXT_PRIs, this->hostname_); } if (this->port_number_ != ACE_DEFAULT_HTTP_PORT) @@ -545,13 +535,13 @@ ACE_HTTP_Addr::addr_to_string (ACE_TCHAR *buffer, if (this->path_ != 0) { n += ACE_OS::sprintf (buffer + n, - ACE_TEXT ("/") ACE_PRINTF_S, + ACE_TEXT ("/%") ACE_TEXT_PRIs, this->path_); } if (this->query_ != 0) { n += ACE_OS::sprintf (buffer + n, - ACE_TEXT ("?") ACE_PRINTF_S, + ACE_TEXT ("?%") ACE_TEXT_PRIs, this->query_); } return 0; @@ -704,12 +694,12 @@ ACE_FTP_Addr::addr_to_string (ACE_TCHAR *buffer, if (this->user_ != 0) { - n += ACE_OS::sprintf (buffer + n, ACE_PRINTF_S, this->user_); + n += ACE_OS::sprintf (buffer + n, ACE_TEXT ("%") ACE_TEXT_PRIs, this->user_); } if (this->password_ != 0) { n += ACE_OS::sprintf (buffer + n, - ACE_TEXT (":") ACE_PRINTF_S, + ACE_TEXT (":%") ACE_TEXT_PRIs, this->password_); } @@ -721,16 +711,16 @@ ACE_FTP_Addr::addr_to_string (ACE_TCHAR *buffer, if (flags == 0) { ACE_INET_Addr inet = this->get_inet_address (); - n += ACE_OS::sprintf (buffer + n, ACE_PRINTF_S, inet.get_host_addr ()); + n += ACE_OS::sprintf (buffer + n, ACE_TEXT ("%") ACE_TEXT_PRIs, inet.get_host_addr ()); } else { - n += ACE_OS::sprintf (buffer + n, ACE_PRINTF_S, this->hostname_); + n += ACE_OS::sprintf (buffer + n, ACE_TEXT ("%") ACE_TEXT_PRIs, this->hostname_); } if (this->path_ != 0) { n += ACE_OS::sprintf (buffer + n, - ACE_TEXT ("/") ACE_PRINTF_S, + ACE_TEXT ("/%") ACE_TEXT_PRIs, this->path_); } return 0; @@ -915,12 +905,12 @@ ACE_Mailto_Addr::addr_to_string (ACE_TCHAR *buffer, return -1; size_t n = ACE_OS::sprintf (buffer, - ACE_TEXT ("mailto:") ACE_PRINTF_S ACE_TEXT - ("@") ACE_PRINTF_S, + ACE_TEXT ("mailto:%") ACE_TEXT_PRIs + ACE_TEXT ("@%") ACE_TEXT_PRIs, this->user_, this->hostname_); if (this->headers_ != 0) { - n += ACE_OS::sprintf (buffer + n, ACE_TEXT ("?") ACE_PRINTF_S, + n += ACE_OS::sprintf (buffer + n, ACE_TEXT ("?%") ACE_TEXT_PRIs, this->headers_); } diff --git a/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp index eaad5ff3dc1..cced9d94274 100644 --- a/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp +++ b/TAO/orbsvcs/FTRT_Event_Service/Factory_Service/EventChannelFactory_i.cpp @@ -101,7 +101,8 @@ CORBA::Object_ptr EventChannelFactory_i::create_process ( const int ENV_BUF_LEN = 512; ACE_TCHAR buf[ENV_BUF_LEN]; server_addr.addr_to_string(buf,ENV_BUF_LEN,0); - options.setenv(ACE_TEXT("EventChannelFactoryAddr"), buf); + options.setenv(ACE_TEXT("EventChannelFactoryAddr"), + ACE_TEXT("%") ACE_TEXT_PRIs, buf); // extract the object ID from the criteria for (CORBA::ULong i = 0; i < the_criteria.length(); ++i) @@ -112,7 +113,8 @@ CORBA::Object_ptr EventChannelFactory_i::create_process ( const char* id_str = name[0].id.in(); the_criteria[i].val >>= val; if (id_str[0] != '-') // environment variable - options.setenv(ACE_TEXT_CHAR_TO_TCHAR(id_str), ACE_TEXT("%s"), val); + options.setenv(ACE_TEXT_CHAR_TO_TCHAR(id_str), + ACE_TEXT("%") ACE_TEXT_PRIs, val); else {// command line option ACE_OS::sprintf(buf, ACE_TEXT(" %s %s"), id_str, val); str += buf; @@ -122,7 +124,7 @@ CORBA::Object_ptr EventChannelFactory_i::create_process ( ORBSVCS_DEBUG((LM_DEBUG, "Command Line : %s\n", str.c_str())); - options.command_line(str.c_str()); + options.command_line(ACE_TEXT("%") ACE_TEXT_PRIs, str.c_str()); // Try to create a new process running date. ACE_Process new_process; diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp index 18e34e05ea4..4b281396eb3 100644 --- a/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Activator_i.cpp @@ -537,7 +537,7 @@ ImR_Activator_i::start_server(const char* name, 1, cmdline_buf_len + 1, this->env_buf_len_, this->max_env_vars_); - proc_opts.command_line (ACE_TEXT_CHAR_TO_TCHAR(cmdline)); + proc_opts.command_line (ACE_TEXT("%") ACE_TEXT_PRIs, ACE_TEXT_CHAR_TO_TCHAR(cmdline)); proc_opts.working_directory (dir); // Win32 does not support the CLOSE_ON_EXEC semantics for sockets // the way unix does, so in order to avoid having the child process @@ -564,13 +564,13 @@ ImR_Activator_i::start_server(const char* name, { CORBA::String_var ior = orb_->object_to_string (locator_.in ()); proc_opts.setenv (ACE_TEXT ("ImplRepoServiceIOR"), - ACE_TEXT_CHAR_TO_TCHAR (ior.in ())); + ACE_TEXT("%") ACE_TEXT_PRIs, ACE_TEXT_CHAR_TO_TCHAR (ior.in ())); } for (CORBA::ULong i = 0; i < env.length (); ++i) { proc_opts.setenv (ACE_TEXT_CHAR_TO_TCHAR (env[i].name.in ()), - ACE_TEXT_CHAR_TO_TCHAR (env[i].value.in ())); + ACE_TEXT("%") ACE_TEXT_PRIs, ACE_TEXT_CHAR_TO_TCHAR (env[i].value.in ())); } pid = this->process_mgr_.spawn (proc_opts, this); diff --git a/TAO/orbsvcs/tests/HTIOP/test_config.h b/TAO/orbsvcs/tests/HTIOP/test_config.h index 010fff62047..6a0904281cf 100644 --- a/TAO/orbsvcs/tests/HTIOP/test_config.h +++ b/TAO/orbsvcs/tests/HTIOP/test_config.h @@ -126,14 +126,12 @@ size_t const ACE_MAX_THREADS = 4; } #else /* ! VXWORKS */ -# if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) -# define ACE_INIT_LOG_FMT ACE_TEXT ("%ls%ls%ls") -# else -# define ACE_INIT_LOG_FMT ACE_TEXT ("%s%s%s") -# endif /* !ACE_WIN32 && ACE_USES_WCHAR */ #define ACE_INIT_LOG(NAME) \ ACE_TCHAR temp[MAXPATHLEN]; \ - ACE_OS::sprintf (temp, ACE_INIT_LOG_FMT, \ + ACE_OS::sprintf (temp, \ + ACE_TEXT ("%") ACE_TEXT_PRIs \ + ACE_TEXT ("%") ACE_TEXT_PRIs \ + ACE_TEXT ("%") ACE_TEXT_PRIs, \ ACE_LOG_DIRECTORY, \ ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR), \ ACE_LOG_FILE_EXT_NAME); \ diff --git a/TAO/tao/Wait_On_LF_No_Upcall.cpp b/TAO/tao/Wait_On_LF_No_Upcall.cpp index c6d79a32ff4..6009312c714 100644 --- a/TAO/tao/Wait_On_LF_No_Upcall.cpp +++ b/TAO/tao/Wait_On_LF_No_Upcall.cpp @@ -11,10 +11,6 @@ namespace TAO { } - Wait_On_LF_No_Upcall::~Wait_On_LF_No_Upcall () - { - } - int Wait_On_LF_No_Upcall::wait (ACE_Time_Value *max_wait_time, TAO_Synch_Reply_Dispatcher &rd) diff --git a/TAO/tao/Wait_On_LF_No_Upcall.h b/TAO/tao/Wait_On_LF_No_Upcall.h index e43a247c9da..caf40f38828 100644 --- a/TAO/tao/Wait_On_LF_No_Upcall.h +++ b/TAO/tao/Wait_On_LF_No_Upcall.h @@ -44,17 +44,16 @@ namespace TAO explicit Wait_On_LF_No_Upcall (TAO_Transport *t); /// Destructor. - virtual ~Wait_On_LF_No_Upcall (); + ~Wait_On_LF_No_Upcall () override = default; /*! @copydoc TAO_Wait_Strategy::wait() */ - virtual int wait (ACE_Time_Value *max_wait_time, - TAO_Synch_Reply_Dispatcher &rd); + int wait (ACE_Time_Value *max_wait_time, TAO_Synch_Reply_Dispatcher &rd) override; /*! @copydoc TAO_Wait_Strategy::can_process_upcalls() */ - virtual bool can_process_upcalls () const; + bool can_process_upcalls () const override; /*! @copydoc TAO_Wait_Strategy::defer_upcall() */ - virtual int defer_upcall (ACE_Event_Handler*); + int defer_upcall (ACE_Event_Handler*) override; }; } diff --git a/TAO/tao/Wait_On_Leader_Follower.cpp b/TAO/tao/Wait_On_Leader_Follower.cpp index 4491baac65e..348bf3b307f 100644 --- a/TAO/tao/Wait_On_Leader_Follower.cpp +++ b/TAO/tao/Wait_On_Leader_Follower.cpp @@ -13,10 +13,6 @@ TAO_Wait_On_Leader_Follower::TAO_Wait_On_Leader_Follower { } -TAO_Wait_On_Leader_Follower::~TAO_Wait_On_Leader_Follower () -{ -} - int TAO_Wait_On_Leader_Follower::register_handler () { diff --git a/TAO/tao/Wait_On_Leader_Follower.h b/TAO/tao/Wait_On_Leader_Follower.h index bac0563a481..23b854d39b1 100644 --- a/TAO/tao/Wait_On_Leader_Follower.h +++ b/TAO/tao/Wait_On_Leader_Follower.h @@ -39,26 +39,25 @@ class TAO_Wait_On_Leader_Follower : public TAO_Wait_Strategy { public: /// Constructor. - TAO_Wait_On_Leader_Follower (TAO_Transport *transport); + explicit TAO_Wait_On_Leader_Follower (TAO_Transport *transport); /// Destructor. - virtual ~TAO_Wait_On_Leader_Follower (); + ~TAO_Wait_On_Leader_Follower () override = default; /*! @copydoc TAO_Wait_Strategy::sending_request() */ - virtual int sending_request (TAO_ORB_Core *orb_core, TAO_Message_Semantics msg_semantics); + int sending_request (TAO_ORB_Core *orb_core, TAO_Message_Semantics msg_semantics) override; /*! @copydoc TAO_Wait_Strategy::wait() */ - virtual int wait (ACE_Time_Value *max_wait_time, - TAO_Synch_Reply_Dispatcher &rd); + int wait (ACE_Time_Value *max_wait_time, TAO_Synch_Reply_Dispatcher &rd) override; /*! @copydoc TAO_Wait_Strategy::register_handler() */ - virtual int register_handler (); + int register_handler () override; /*! @copydoc TAO_Wait_Strategy::non_blocking() */ - virtual bool non_blocking () const; + bool non_blocking () const override; /*! @copydoc TAO_Wait_Strategy::can_process_upcalls() */ - virtual bool can_process_upcalls () const; + bool can_process_upcalls () const override; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Wait_On_Reactor.cpp b/TAO/tao/Wait_On_Reactor.cpp index 4e73e0109f9..2394a6506a9 100644 --- a/TAO/tao/Wait_On_Reactor.cpp +++ b/TAO/tao/Wait_On_Reactor.cpp @@ -13,10 +13,6 @@ TAO_Wait_On_Reactor::TAO_Wait_On_Reactor (TAO_Transport *transport) { } -TAO_Wait_On_Reactor::~TAO_Wait_On_Reactor () -{ -} - int TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time, TAO_Synch_Reply_Dispatcher &rd) diff --git a/TAO/tao/Wait_On_Reactor.h b/TAO/tao/Wait_On_Reactor.h index b090ecaac34..bfd66ee16b3 100644 --- a/TAO/tao/Wait_On_Reactor.h +++ b/TAO/tao/Wait_On_Reactor.h @@ -33,20 +33,19 @@ public: explicit TAO_Wait_On_Reactor (TAO_Transport *transport); /// Destructor. - virtual ~TAO_Wait_On_Reactor (); + ~TAO_Wait_On_Reactor () override = default; /*! @copydoc TAO_Wait_Strategy::wait() */ - virtual int wait (ACE_Time_Value *max_wait_time, - TAO_Synch_Reply_Dispatcher &rd); + int wait (ACE_Time_Value *max_wait_time, TAO_Synch_Reply_Dispatcher &rd) override; /*! @copydoc TAO_Wait_Strategy::register_handler() */ - virtual int register_handler (); + int register_handler () override; /*! @copydoc TAO_Wait_Strategy::non_blocking() */ - virtual bool non_blocking () const; + bool non_blocking () const override; /*! @copydoc TAO_Wait_Strategy::can_process_upcalls() */ - virtual bool can_process_upcalls () const; + bool can_process_upcalls () const override; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Wait_On_Read.cpp b/TAO/tao/Wait_On_Read.cpp index 0105e9ed5f4..92bcdba8467 100644 --- a/TAO/tao/Wait_On_Read.cpp +++ b/TAO/tao/Wait_On_Read.cpp @@ -15,11 +15,6 @@ TAO_Wait_On_Read::TAO_Wait_On_Read (TAO_Transport *transport) { } -// Destructor. -TAO_Wait_On_Read::~TAO_Wait_On_Read () -{ -} - int TAO_Wait_On_Read::sending_request (TAO_ORB_Core *orb_core, TAO_Message_Semantics msg_semantics) diff --git a/TAO/tao/Wait_On_Read.h b/TAO/tao/Wait_On_Read.h index e5a76c0750e..1fa4703e508 100644 --- a/TAO/tao/Wait_On_Read.h +++ b/TAO/tao/Wait_On_Read.h @@ -31,26 +31,25 @@ public: explicit TAO_Wait_On_Read (TAO_Transport *transport); /// Destructor. - virtual ~TAO_Wait_On_Read (); + ~TAO_Wait_On_Read () override = default; /*! @copydoc TAO_Wait_Strategy::sending_request() */ - virtual int sending_request (TAO_ORB_Core *orb_core, TAO_Message_Semantics msg_semantics); + int sending_request (TAO_ORB_Core *orb_core, TAO_Message_Semantics msg_semantics) override; /*! @copydoc TAO_Wait_Strategy::finished_request() */ - virtual void finished_request (); + void finished_request () override; /*! @copydoc TAO_Wait_Strategy::wait() */ - virtual int wait (ACE_Time_Value *max_wait_time, - TAO_Synch_Reply_Dispatcher &rd); + int wait (ACE_Time_Value *max_wait_time, TAO_Synch_Reply_Dispatcher &rd) override; /*! @copydoc TAO_Wait_Strategy::register_handler() */ - virtual int register_handler (); + int register_handler () override; /*! @copydoc TAO_Wait_Strategy::non_blocking() */ - virtual bool non_blocking () const; + bool non_blocking () const override; /*! @copydoc TAO_Wait_Strategy::can_process_upcalls() */ - virtual bool can_process_upcalls () const; + bool can_process_upcalls () const override; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Wait_Strategy.cpp b/TAO/tao/Wait_Strategy.cpp index fc13c417789..fa0258db6c6 100644 --- a/TAO/tao/Wait_Strategy.cpp +++ b/TAO/tao/Wait_Strategy.cpp @@ -13,11 +13,6 @@ TAO_Wait_Strategy::TAO_Wait_Strategy (TAO_Transport *transport) { } -// Destructor. -TAO_Wait_Strategy::~TAO_Wait_Strategy () -{ -} - int TAO_Wait_Strategy::defer_upcall (ACE_Event_Handler*) { diff --git a/TAO/tao/Wait_Strategy.h b/TAO/tao/Wait_Strategy.h index 866ec9cb38e..c900be668fc 100644 --- a/TAO/tao/Wait_Strategy.h +++ b/TAO/tao/Wait_Strategy.h @@ -45,7 +45,7 @@ public: explicit TAO_Wait_Strategy (TAO_Transport *transport); /// Destructor. - virtual ~TAO_Wait_Strategy (); + virtual ~TAO_Wait_Strategy () = default; /** * The user is going to send a request, prepare any internal diff --git a/TAO/tests/IDL_Test/Versioned_Namespace/TestVersionedNamespace.idl b/TAO/tests/IDL_Test/Versioned_Namespace/TestVersionedNamespace.idl index caad747cd8f..47bca7d3295 100644 --- a/TAO/tests/IDL_Test/Versioned_Namespace/TestVersionedNamespace.idl +++ b/TAO/tests/IDL_Test/Versioned_Namespace/TestVersionedNamespace.idl @@ -1,5 +1,4 @@ module M1 { - struct S1 { octet o; }; @@ -13,28 +12,4 @@ module M1 { public S1 valStruct; public LI valLocalIface; }; - -}; - -module M2 { - module M3 { - struct S2 { - octet o; - }; - - local interface L2 { - void op(in S2 s); - }; - - valuetype V2 { - public string valString; - public S2 valStruct; - public L2 valLocalIface; - }; - valuetype V3 { - public string valString; - public M1::S1 valStruct; - public M1::LI valLocalIface; - }; - }; }; diff --git a/TAO/tests/IDL_Test/Versioned_Namespace/TestVersionedNamespace2.idl b/TAO/tests/IDL_Test/Versioned_Namespace/TestVersionedNamespace2.idl new file mode 100644 index 00000000000..35fa1398044 --- /dev/null +++ b/TAO/tests/IDL_Test/Versioned_Namespace/TestVersionedNamespace2.idl @@ -0,0 +1,73 @@ +module M1 { + + struct S1 { + octet o; + }; + + interface LI { + void op(in S1 s); + }; + + interface L2 { + void op(in S1 s); + }; + + struct X { + string valString; + S1 valStruct; + L2 valLocalIface; + }; + + union BooleanUnion1 switch (boolean) + { + case TRUE: L2 valLocalIface; + }; + + union BooleanUnion2 switch (boolean) + { + case TRUE: string valLocalIface; + }; + + valuetype V { + public string valString; + public S1 valStruct; + public LI valLocalIface; + public BooleanUnion1 valBoolUnion1; + public BooleanUnion2 valBoolUnion2; + public X valX; + }; +}; + +module M2 { + module M3 { + struct S2 { + octet o; + }; + + interface L3 { + void op(in S2 s); + }; + + exception E1 { + L3 val2; + M1::BooleanUnion1 bool1; + M1::BooleanUnion2 bool2; + }; + + interface L4 { + void op(in S2 s) raises (E1); + }; + + valuetype V2 { + public string valString; + public S2 valStruct; + public L3 valLocalIface; + public L4 valLocalIface3; + }; + valuetype V3 { + public string valString; + public M1::S1 valStruct; + public M1::L2 valLocalIface; + }; + }; +}; diff --git a/TAO/tests/IDL_Test/Versioned_Namespace/Versioned_Namespace.mpc b/TAO/tests/IDL_Test/Versioned_Namespace/Versioned_Namespace.mpc index 4432c15dc4b..fa233b74d09 100644 --- a/TAO/tests/IDL_Test/Versioned_Namespace/Versioned_Namespace.mpc +++ b/TAO/tests/IDL_Test/Versioned_Namespace/Versioned_Namespace.mpc @@ -1,7 +1,29 @@ // -*- MPC -*- -project(IDL_Test_Versioned_Namespace): taoidldefaults, valuetype { +project(IDL_Test_Versioned_Namespace_1): taoidldefaults, valuetype { + idlflags += -Wb,versioning_begin=BEGIN_USER_VERSIONED_NAMESPACE \ + -Wb,versioning_end=END_USER_VERSIONED_NAMESPACE \ + -Wb,versioning_include=UserVersionedNamespace.h idlflags += -Scdr -Sa + IDL_Files { + TestVersionedNamespace.idl + } + + Source_Files { + TestVersionedNamespaceC.cpp + TestVersionedNamespaceS.cpp + } +} + +project(IDL_Test_Versioned_Namespace_2): taoidldefaults, valuetype, amh { idlflags += -Wb,versioning_begin=BEGIN_USER_VERSIONED_NAMESPACE \ -Wb,versioning_end=END_USER_VERSIONED_NAMESPACE \ -Wb,versioning_include=UserVersionedNamespace.h + IDL_Files { + TestVersionedNamespace2.idl + } + + Source_Files { + TestVersionedNamespace2C.cpp + TestVersionedNamespace2S.cpp + } } |