diff options
Diffstat (limited to 'ACE/ace/OS_NS_string.inl')
-rw-r--r-- | ACE/ace/OS_NS_string.inl | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/ACE/ace/OS_NS_string.inl b/ACE/ace/OS_NS_string.inl index 204ea5db435..8f25a46615c 100644 --- a/ACE/ace/OS_NS_string.inl +++ b/ACE/ace/OS_NS_string.inl @@ -12,11 +12,11 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE const void * ACE_OS::memchr (const void *s, int c, size_t len) { -#if defined (ACE_HAS_MEMCHR) +#if !defined (ACE_LACKS_MEMCHR) return ::memchr (s, c, len); -#else /* ACE_HAS_MEMCHR */ +#else /* ACE_LACKS_MEMCHR */ return ACE_OS::memchr_emulation (s, c, len); -#endif /* ACE_HAS_MEMCHR */ +#endif /* !ACE_LACKS_MEMCHR */ } ACE_INLINE void * @@ -125,11 +125,7 @@ ACE_OS::strcat (wchar_t *s, const wchar_t *t) ACE_INLINE const char * ACE_OS::strchr (const char *s, int c) { -#if defined (ACE_LACKS_STRCHR) - return ACE_OS::strchr_emulation (s, c); -#else /* ! ACE_LACKS_STRCHR */ - return (const char *) ::strchr (s, c); -#endif /* ACE_LACKS_STRCHR */ + return const_cast <const char *> (::strchr (s, c)); } #if defined (ACE_HAS_WCHAR) @@ -357,7 +353,8 @@ ACE_OS::strnlen (const ACE_WCHAR_T *s, size_t maxlen) ACE_INLINE char * ACE_OS::strnstr (char *s, const char *t, size_t len) { - return (char *) ACE_OS::strnstr ((const char *) s, t, len); + return + const_cast <char *> (ACE_OS::strnstr (const_cast <const char *> (s), t, len)); } ACE_INLINE ACE_WCHAR_T * @@ -373,11 +370,7 @@ ACE_OS::strnstr (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len) ACE_INLINE const char * ACE_OS::strpbrk (const char *s1, const char *s2) { -#if defined (ACE_LACKS_STRPBRK) - return ACE_OS::strpbrk_emulation (s1, s2); -#else /* ACE_LACKS_STRPBRK */ - return (const char *) ::strpbrk (s1, s2); -#endif /* ACE_LACKS_STRPBRK */ + return const_cast <const char *> (::strpbrk (s1, s2)); } #if defined (ACE_HAS_WCHAR) @@ -395,11 +388,7 @@ ACE_OS::strpbrk (const wchar_t *s, const wchar_t *t) ACE_INLINE char * ACE_OS::strpbrk (char *s1, const char *s2) { -#if defined (ACE_LACKS_STRPBRK) - return ACE_OS::strpbrk_emulation (s1, s2); -#else /* ACE_LACKS_STRPBRK */ return ::strpbrk (s1, s2); -#endif /* ACE_LACKS_STRPBRK */ } #if defined (ACE_HAS_WCHAR) @@ -455,11 +444,7 @@ ACE_OS::strrchr (wchar_t *s, wchar_t c) ACE_INLINE size_t ACE_OS::strspn (const char *s, const char *t) { -#if defined (ACE_LACKS_STRSPN) - return ACE_OS::strspn_emulation (s, t); -#else /* ACE_LACKS_STRSPN */ return ::strspn (s, t); -#endif /* ACE_LACKS_STRSPN */ } #if defined (ACE_HAS_WCHAR) |