summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-08-07 04:47:54 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-08-07 04:47:54 +0000
commit9845da4c74f1c38b652bc824842640c3c2d76629 (patch)
treea3b203e85564fc2c0222a661cc2e7da7b4b9421a
parent55cdc852d4313ddcac98f81dfb226caa76720d0b (diff)
downloadATCD-9845da4c74f1c38b652bc824842640c3c2d76629.tar.gz
ChangeLogTag:Sun Aug 6 21:40:42 2000 Darrell Brunsch <brunsch@uci.edu>
-rw-r--r--ChangeLog25
-rw-r--r--ChangeLogs/ChangeLog-02a25
-rw-r--r--ChangeLogs/ChangeLog-03a25
-rw-r--r--ace/OS.cpp22
-rw-r--r--ace/OS.i9
-rw-r--r--ace/OS_String.cpp10
-rw-r--r--ace/OS_String.h1
-rw-r--r--ace/OS_String.inl6
-rw-r--r--ace/ace_wchar.h9
-rw-r--r--ace/config-all.h16
-rw-r--r--ace/config-linux-common.h4
-rw-r--r--ace/config-win32-common.h3
12 files changed, 140 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 5252e3cf72d..7858e453424 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+Sun Aug 6 21:40:42 2000 Darrell Brunsch <brunsch@uci.edu>
+
+ * ace/OS.i:
+ * ace/OS.cpp:
+ * ace/OS_String.cpp:
+ * ace/OS_String.h:
+ * ace/OS_String.inl:
+ * ace/ace_wchar.h:
+ * ace/config-all.h
+ * ace/config-linux-common.h:
+ * ace/config-win32-common.h:
+
+ Fixed up miscellaneous problems with ACE_HAS_WCHAR on Linux.
+ Highlights are:
+
+ - Added ACE_HAS_VFWPRINTF and ACE_HAS_VFWPRINTF to NOTSUP a
+ couple of methods, since they don't seem to be available yet.
+ - Added ACE_LACKS_WCSDUP_PROTOTYPE, and added the prototype.
+ - Removed an extra copy of itoa_emulation (..wchar_t..).
+ - Added some static_cast's to remove unsigned/signed comparison
+ warnings.
+ - Added ACE-HAS_SAFE_WCSTOK, since the version supplied with MSVC
+ is the multi-threaded unsafe version (just like strtok). Here
+ it is similar to strtok_r.
+
Sun Aug 6 17:03:29 2000 Ossama Othman <ossama@uci.edu>
* include/makeinclude/wrapper_macros.GNU (CPPFLAGS):
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 5252e3cf72d..7858e453424 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,28 @@
+Sun Aug 6 21:40:42 2000 Darrell Brunsch <brunsch@uci.edu>
+
+ * ace/OS.i:
+ * ace/OS.cpp:
+ * ace/OS_String.cpp:
+ * ace/OS_String.h:
+ * ace/OS_String.inl:
+ * ace/ace_wchar.h:
+ * ace/config-all.h
+ * ace/config-linux-common.h:
+ * ace/config-win32-common.h:
+
+ Fixed up miscellaneous problems with ACE_HAS_WCHAR on Linux.
+ Highlights are:
+
+ - Added ACE_HAS_VFWPRINTF and ACE_HAS_VFWPRINTF to NOTSUP a
+ couple of methods, since they don't seem to be available yet.
+ - Added ACE_LACKS_WCSDUP_PROTOTYPE, and added the prototype.
+ - Removed an extra copy of itoa_emulation (..wchar_t..).
+ - Added some static_cast's to remove unsigned/signed comparison
+ warnings.
+ - Added ACE-HAS_SAFE_WCSTOK, since the version supplied with MSVC
+ is the multi-threaded unsafe version (just like strtok). Here
+ it is similar to strtok_r.
+
Sun Aug 6 17:03:29 2000 Ossama Othman <ossama@uci.edu>
* include/makeinclude/wrapper_macros.GNU (CPPFLAGS):
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 5252e3cf72d..7858e453424 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,28 @@
+Sun Aug 6 21:40:42 2000 Darrell Brunsch <brunsch@uci.edu>
+
+ * ace/OS.i:
+ * ace/OS.cpp:
+ * ace/OS_String.cpp:
+ * ace/OS_String.h:
+ * ace/OS_String.inl:
+ * ace/ace_wchar.h:
+ * ace/config-all.h
+ * ace/config-linux-common.h:
+ * ace/config-win32-common.h:
+
+ Fixed up miscellaneous problems with ACE_HAS_WCHAR on Linux.
+ Highlights are:
+
+ - Added ACE_HAS_VFWPRINTF and ACE_HAS_VFWPRINTF to NOTSUP a
+ couple of methods, since they don't seem to be available yet.
+ - Added ACE_LACKS_WCSDUP_PROTOTYPE, and added the prototype.
+ - Removed an extra copy of itoa_emulation (..wchar_t..).
+ - Added some static_cast's to remove unsigned/signed comparison
+ warnings.
+ - Added ACE-HAS_SAFE_WCSTOK, since the version supplied with MSVC
+ is the multi-threaded unsafe version (just like strtok). Here
+ it is similar to strtok_r.
+
Sun Aug 6 17:03:29 2000 Ossama Othman <ossama@uci.edu>
* include/makeinclude/wrapper_macros.GNU (CPPFLAGS):
diff --git a/ace/OS.cpp b/ace/OS.cpp
index e20f99abb76..ec14c1277ce 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -977,16 +977,21 @@ int
ACE_OS::fprintf (FILE *fp, const wchar_t *format, ...)
{
ACE_TRACE ("ACE_OS::fprintf");
-# if defined (ACE_HAS_WINCE)
+
+# if !defined (ACE_HAS_VFWPRINTF)
+ ACE_UNUSED_ARG (fp);
+ ACE_UNUSED_ARG (format);
ACE_NOTSUP_RETURN (-1);
-# else /* ACE_HAS_WINCE */
+
+# else
int result = 0;
va_list ap;
va_start (ap, format);
ACE_OSCALL (::vfwprintf (fp, format, ap), int, -1, result);
va_end (ap);
return result;
-# endif /* ACE_HAS_WINCE */
+
+# endif /* ACE_HAS_VFWPRINTF */
}
#endif /* ACE_HAS_WCHAR */
@@ -1020,12 +1025,23 @@ int
ACE_OS::sprintf (wchar_t *buf, const wchar_t *format, ...)
{
ACE_TRACE ("ACE_OS::sprintf");
+
+# if defined (ACE_HAS_VSWPRINTF)
+
int result;
va_list ap;
va_start (ap, format);
ACE_OSCALL (::vswprintf (buf, format, ap), int, -1, result);
va_end (ap);
return result;
+
+# else
+
+ ACE_UNUSED_ARG (buf);
+ ACE_UNUSED_ARG (format);
+ ACE_NOTSUP_RETURN (-1);
+
+# endif /* ACE_HAS_VSWPRINTF */
}
#endif /* ACE_HAS_WCHAR */
diff --git a/ace/OS.i b/ace/OS.i
index bc8dd862fbc..f7adbf296ad 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -1428,7 +1428,16 @@ ACE_OS::vsprintf (char *buffer, const char *format, va_list argptr)
ACE_INLINE int
ACE_OS::vsprintf (wchar_t *buffer, const wchar_t *format, va_list argptr)
{
+# if defined (ACE_HAS_VSWPRINTF)
return ::vswprintf (buffer, format, argptr);
+
+# else
+ ACE_UNUSED_ARG (buffer);
+ ACE_UNUSED_ARG (format);
+ ACE_UNUSED_ARG (argptr);
+ ACE_NOTSUP_RETURN (-1);
+
+# endif /* ACE_HAS_VSWPRINTF */
}
#endif /* ACE_HAS_WCHAR */
diff --git a/ace/OS_String.cpp b/ace/OS_String.cpp
index 12afa4ee4cc..82b8d4b767f 100644
--- a/ace/OS_String.cpp
+++ b/ace/OS_String.cpp
@@ -9,6 +9,10 @@ ACE_RCSID(ace, OS_String, "$Id$")
# include "ace/OS_String.inl"
#endif /* ACE_HAS_INLINED_OS_CALLS */
+#if defined (ACE_LACKS_WCSDUP_PROTOTYPE)
+extern "C" wchar_t *wcsdup __P ((__const wchar_t *__s));
+#endif /* ACE_LACKS_WCSDUP_PROTOTYPE */
+
const char *
ACE_OS_String::strnstr (const char *s1, const char *s2, size_t len2)
{
@@ -126,7 +130,7 @@ const wchar_t *
ACE_OS_String::strnchr (const wchar_t *s, wint_t c, size_t len)
{
for (size_t i = 0; i < len; i++)
- if (s[i] == c)
+ if (s[i] == ACE_static_cast(wchar_t, c))
return s + i;
return 0;
@@ -167,7 +171,7 @@ ACE_OS_String::strrchr_emulation (const wchar_t *s, wint_t c)
{
const wchar_t *p = s + ACE_OS_String::strlen (s);
- while (*p != c)
+ while (*p != ACE_static_cast (wchar_t, c))
if (p == s)
return 0;
else
@@ -181,7 +185,7 @@ ACE_OS_String::strrchr_emulation (wchar_t *s, wint_t c)
{
wchar_t *p = s + ACE_OS_String::strlen (s);
- while (*p != c)
+ while (*p != ACE_static_cast(wchar_t, c))
if (p == s)
return 0;
else
diff --git a/ace/OS_String.h b/ace/OS_String.h
index e5234da226d..e9a9f82239b 100644
--- a/ace/OS_String.h
+++ b/ace/OS_String.h
@@ -179,7 +179,6 @@ private:
static int strncasecmp_emulation (const wchar_t *s,
const wchar_t *t,
size_t len);
- static wchar_t *itoa_emulation (int value, wchar_t *string, int radix);
#endif /* ACE_HAS_WCHAR */
diff --git a/ace/OS_String.inl b/ace/OS_String.inl
index a885f874023..d81ae33e17f 100644
--- a/ace/OS_String.inl
+++ b/ace/OS_String.inl
@@ -530,7 +530,13 @@ ACE_OS_String::strtok (char *s, const char *tokens)
ACE_INLINE wchar_t *
ACE_OS_String::strtok (wchar_t *s, const wchar_t *tokens)
{
+# if defined (ACE_HAS_SAFE_WCSTOK)
+ ACE_UNUSED_ARG(s);
+ ACE_UNUSED_ARG(tokens);
+ ACE_NOTSUP_RETURN (0);
+# else
return ::wcstok (s, tokens);
+# endif /* ACE_HAS_SAFE_WCSTOK */
}
#endif /* ACE_HAS_WCHAR */
diff --git a/ace/ace_wchar.h b/ace/ace_wchar.h
index 2d37a6d453c..d0116b4347f 100644
--- a/ace/ace_wchar.h
+++ b/ace/ace_wchar.h
@@ -74,6 +74,7 @@ typedef char TCHAR;
# elif defined (ACE_HAS_STANDARD_CPP_LIBRARY) && \
(ACE_HAS_STANDARD_CPP_LIBRARY != 0)
# include /**/ <cwchar>
+# include /**/ <cwctype>
# elif !defined (__BORLANDC__) && !defined (ACE_HAS_WINCE)
# include /**/ <wchar.h>
# endif /* ACE_HAS_STANDARD_CPP_LIBRARY */
@@ -86,6 +87,14 @@ typedef char TCHAR;
using std::size_t;
#endif /* ACE_USES_STD_NAMESPACE_FOR_STDC_LIB */
+// Since MSVC uses ushort16 = wchar_t, it is the only one
+// that does not need this defined
+
+#if defined (ACE_HAS_WCHAR) && !defined (_MSC_VER)
+# if !defined (ACE_WSTRING_HAS_USHORT_SUPPORT)
+# define ACE_WSTRING_HAS_USHORT_SUPPORT
+# endif /* ACE_WSTRING_HAS_USHORT_SUPPORT */
+#endif /* ACE_HAS_WCHAR && !_MSC_VER */
// Define the unicode/wchar related macros correctly
diff --git a/ace/config-all.h b/ace/config-all.h
index 4b825184129..cc4697f523c 100644
--- a/ace/config-all.h
+++ b/ace/config-all.h
@@ -132,14 +132,6 @@
# endif /* ! ACE_HAS_MUTABLE_KEYWORD */
// ============================================================================
-// UNICODE macros (to be added later)
-// ============================================================================
-
-// Get the unicode (i.e. ACE_TCHAR) defines
-# include "ace/ace_wchar.h"
-
-
-// ============================================================================
// EXPORT macros
//
// Since Win32 DLL's do not export all symbols by default, they must be
@@ -310,6 +302,14 @@
# endif /* ! ACE_CAST_CONST */
// ============================================================================
+// UNICODE macros (to be added later)
+// ============================================================================
+
+// Get the unicode (i.e. ACE_TCHAR) defines
+# include "ace/ace_wchar.h"
+
+
+// ============================================================================
// Compiler Silencing macros
//
// Some compilers complain about parameters that are not used. This macro
diff --git a/ace/config-linux-common.h b/ace/config-linux-common.h
index 7881fdd4b73..bd1552d8b75 100644
--- a/ace/config-linux-common.h
+++ b/ace/config-linux-common.h
@@ -134,6 +134,10 @@
# define ACE_HAS_SIGSUSPEND
+// Some misc wide character stuff
+# define ACE_HAS_SAFE_WCSTOK
+# define ACE_LACKS_WCSDUP_PROTOTYPE
+
#if !defined (ACE_DEFAULT_BASE_ADDR)
# define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000)
#endif /* ! ACE_DEFAULT_BASE_ADDR */
diff --git a/ace/config-win32-common.h b/ace/config-win32-common.h
index a2b7e295f95..ebf368700d5 100644
--- a/ace/config-win32-common.h
+++ b/ace/config-win32-common.h
@@ -218,6 +218,9 @@
#define ACE_LACKS_REWINDDIR
#define ACE_LACKS_READDIR_R
+#define ACE_HAS_VSWPRINTF
+#define ACE_HAS_VFWPRINTF
+
#define ACE_SIZEOF_LONG_LONG 8
typedef unsigned __int64 ACE_UINT64;