summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-03-17 05:39:19 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-03-17 05:39:19 +0000
commit818e711905db00954bd72ebf8444a0e0427a69c4 (patch)
treebac278f0ad4e9e1cafcc319ca6d067a4080ba8c2
parent660ae0577b86e24f0488da4ad0595dbf98430989 (diff)
downloadATCD-818e711905db00954bd72ebf8444a0e0427a69c4.tar.gz
Added ACE_LACKS_STRRCHR.
-rw-r--r--ace/OS.i28
-rw-r--r--ace/README1
-rw-r--r--ace/config-WinCE.h1
3 files changed, 22 insertions, 8 deletions
diff --git a/ace/OS.i b/ace/OS.i
index 3a756bce0d1..98905d05e02 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -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