diff options
-rw-r--r-- | ace/OS.i | 28 | ||||
-rw-r--r-- | ace/README | 1 | ||||
-rw-r--r-- | ace/config-WinCE.h | 1 |
3 files changed, 22 insertions, 8 deletions
@@ -1160,26 +1160,38 @@ ACE_OS::strstr (char *s, const char *t) ACE_INLINE char * ACE_OS::strrchr (char *s, int c) { -#if !defined (ACE_HAS_WINCE) // ACE_TRACE ("ACE_OS::strrchr"); +#if !defined (ACE_LACKS_STRRCHR) return ::strrchr (s, c); #else - ACE_UNUSED_ARG (s); - ACE_UNUSED_ARG (c); - ACE_NOTSUP_RETURN (0); + char *p = s + ::strlen (s); + + while (*p != c) + if (p == s) + return 0; + else + p--; + + return p; #endif /* ACE_HAS_WINCE */ } ACE_INLINE const char * ACE_OS::strrchr (const char *s, int c) { -#if !defined (ACE_HAS_WINCE) // ACE_TRACE ("ACE_OS::strrchr"); +#if !defined (ACE_LACKS_STRRCHR) return (const char *) ::strrchr (s, c); #else - ACE_UNUSED_ARG (s); - ACE_UNUSED_ARG (c); - ACE_NOTSUP_RETURN (0); + char *p = s + ::strlen (s); + + while (*p != c) + if (p == s) + return 0; + else + p--; + + return p; #endif /* ACE_HAS_WINCE */ } diff --git a/ace/README b/ace/README index fd20c4a960d..396ed5e832c 100644 --- a/ace/README +++ b/ace/README @@ -267,6 +267,7 @@ ACE_LACKS_SIGACTION Platform lacks struct sigaction (e.g., Win32 and Chorus) ACE_LACKS_SIGNED_CHAR Platform lacks "signed char" type (broken!) ACE_LACKS_SIGSET Platform lacks signal sets (e.g., Chorus and Win32) ACE_LACKS_STREAM_MODULES Compiler can't grok inclusion of ACE_Stream_Modules (i.e., HP/UX 10.x with aCC). +ACE_LACKS_STRRCHR Platform/compiler lacks strrchr () function. ACE_LACKS_STL_DEFAULT_TEMPLATE_PARAMETER STL doesn't have default parameters (e.g., MSVC 4.2) ACE_LACKS_SYS_NERR Platforms/compiler lacks the sys_nerr variable (e.g., VxWorks and MVS). ACE_LACKS_SYSV_MSG_H Platform lacks sys/msg.h (e.g., Chorus and VxWorks) diff --git a/ace/config-WinCE.h b/ace/config-WinCE.h index b81930f82ff..2afe2f7e385 100644 --- a/ace/config-WinCE.h +++ b/ace/config-WinCE.h @@ -83,6 +83,7 @@ #define ACE_LACKS_FILELOCKS #define ACE_LACKS_EXEC #define ACE_LACKS_MKTEMP +#define ACE_LACKS_STRRCHR #define ACE_HAS_MOSTLY_UNICODE_APIS // temporary workspace |