diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2016-05-17 12:23:09 +0200 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2016-05-17 12:23:09 +0200 |
commit | 83330bfd1fefd26347c2c1c2773953ad9f3c7f70 (patch) | |
tree | 174fcbd1a8e18d9aa6c07672efafbc6c2aeda4fe | |
parent | e1629f4ad58b4de7f28c0fc085873208ab4dc127 (diff) | |
download | ATCD-83330bfd1fefd26347c2c1c2773953ad9f3c7f70.tar.gz |
gai_strerror is defined as gai_strerrorA or gai_strerrorW on Windows dependent on Unicode settings. Adapt ACE_OS::gai_strerror for this and invoke this operation as part of a test to make sure we compile this inline code
* ACE/ace/OS_NS_netdb.inl:
* ACE/ace/ace_wchar.h:
* ACE/tests/OS_Test.cpp:
-rw-r--r-- | ACE/ace/OS_NS_netdb.inl | 6 | ||||
-rw-r--r-- | ACE/ace/ace_wchar.h | 2 | ||||
-rw-r--r-- | ACE/tests/OS_Test.cpp | 15 |
3 files changed, 19 insertions, 4 deletions
diff --git a/ACE/ace/OS_NS_netdb.inl b/ACE/ace/OS_NS_netdb.inl index 433f8cfec3f..5f4e4c258e9 100644 --- a/ACE/ace/OS_NS_netdb.inl +++ b/ACE/ace/OS_NS_netdb.inl @@ -785,10 +785,10 @@ ACE_OS::gai_strerror (int errcode) default: return ACE_TEXT ("Unknown error"); } -#elif !defined ACE_WIN32 - return ACE_TEXT_CHAR_TO_TCHAR (::gai_strerror (errcode)); +#elif defined ACE_WIN32 + return ACE_TEXT_gai_strerror (errcode); #else - return ::gai_strerror (errcode); + return ACE_TEXT_CHAR_TO_TCHAR (::gai_strerror (errcode)); #endif } diff --git a/ACE/ace/ace_wchar.h b/ACE/ace/ace_wchar.h index 299c52980dd..dcc8f36fe8f 100644 --- a/ACE/ace/ace_wchar.h +++ b/ACE/ace/ace_wchar.h @@ -273,6 +273,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL #define ACE_TEXT_PdhExpandCounterPath ::PdhExpandCounterPathW #define ACE_TEXT_PdhOpenQuery ::PdhOpenQueryW #define ACE_TEXT_PdhAddCounter ::PdhAddCounterW +#define ACE_TEXT_gai_strerror ::gai_strerrorW #else /* ACE_USES_WCHAR */ #define ACE_LPSTR LPSTR @@ -332,6 +333,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL #define ACE_TEXT_PdhExpandCounterPath ::PdhExpandCounterPathA #define ACE_TEXT_PdhOpenQuery ::PdhOpenQueryA #define ACE_TEXT_PdhAddCounter ::PdhAddCounterA +#define ACE_TEXT_gai_strerror ::gai_strerrorA #endif /* ACE_USES_WCHAR */ #endif /* ACE_WIN32 */ diff --git a/ACE/tests/OS_Test.cpp b/ACE/tests/OS_Test.cpp index ebe9b47eaae..a77b58669ce 100644 --- a/ACE/tests/OS_Test.cpp +++ b/ACE/tests/OS_Test.cpp @@ -1607,11 +1607,24 @@ swab_test (void) } int +gai_strerror_test (void) +{ + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Testing gai_strerror method\n"))); + + const ACE_TCHAR* error_text = ACE_OS::gai_strerror (EAI_FAMILY); + + ACE_UNUSED_ARG (error_text); + + return 0; +} + +int run_main (int, ACE_TCHAR *[]) { ACE_START_TEST (ACE_TEXT ("OS_Test")); - // Enable a locale that has digit gropuing so that snprintf's %'d is + // Enable a locale that has digit grouping so that snprintf's %'d is // different than %d. If the locale is not available the test won't // fail (log file needs to be examined to check formatting). #ifdef ACE_WIN32 |