diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2016-05-17 14:28:15 +0200 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2016-05-17 14:28:15 +0200 |
commit | 4309a39854bf9704c34c251d6e5740b29184aa42 (patch) | |
tree | ec4d031666f0fb384eedfd6687a08edfb5d7309b | |
parent | e1629f4ad58b4de7f28c0fc085873208ab4dc127 (diff) | |
parent | e8814092903b46280c792835e1497aa6cf5acaec (diff) | |
download | ATCD-4309a39854bf9704c34c251d6e5740b29184aa42.tar.gz |
Merge pull request #260 from jwillemsen/master
gai_strerror is defined as gai_strerrorA or gai_strerrorW on Windows dependent on Unicode settings
-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 | 18 |
3 files changed, 22 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..a0485b34bc9 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 @@ -1697,6 +1710,9 @@ run_main (int, ACE_TCHAR *[]) if ((result = version_test ()) != 0) status = result; + if ((result = gai_strerror_test ()) != 0) + status = result; + ACE_END_TEST; return status; } |