summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>1997-11-10 20:08:51 +0000
committerSteve Huston <shuston@riverace.com>1997-11-10 20:08:51 +0000
commit849f2b28120b9e8cea982e4027066cb967ad5583 (patch)
tree1c59f150cfc2432ccfea3f1dabf09bf11274cf82 /ace
parent2f4a281666a41fe450135ada1f84ed535a816a46 (diff)
downloadATCD-849f2b28120b9e8cea982e4027066cb967ad5583.tar.gz
Added new macro ACE_HAS_XPG4_MULTIBYTE_CHAR for platforms that provide
wchar.h and associated wide character functions.
Diffstat (limited to 'ace')
-rw-r--r--ace/OS.h6
-rw-r--r--ace/OS.i8
-rw-r--r--ace/README5
-rw-r--r--ace/config-aix-4.2.x.h2
-rw-r--r--ace/config-hpux-10.x.h3
-rw-r--r--ace/config-sunos5.5-sunc++-4.x.h3
6 files changed, 26 insertions, 1 deletions
diff --git a/ace/OS.h b/ace/OS.h
index 7b64a6fe6b8..06cfaca918c 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -1061,7 +1061,11 @@ struct strrecvfd {};
# include /**/ <wchar.h>
# endif /* ACE_HAS_STANDARD_CPP_LIBRARY */
#else
-typedef long wchar_t;
+# if defined (ACE_HAS_XPG4_MULTIBYTE_CHAR)
+# include /**/ <wchar.h>
+# else
+ typedef long wchar_t;
+# endif /* ACE_HAS_XPG4_MULTIBYTE_CHAR */
#endif /* ACE_HAS_UNICODE */
#if defined (ACE_HAS_BROKEN_WRITEV)
diff --git a/ace/OS.i b/ace/OS.i
index c99b533cbdc..9a23f8bab05 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -7403,12 +7403,16 @@ ACE_OS::strlen (const wchar_t *s)
#if defined (ACE_HAS_UNICODE)
return ::wcslen (s);
#else
+# if defined (ACE_HAS_XPG4_MULTIBYTE_CHAR)
+ return wcslen (s);
+# else
u_int len = 0;
while (*s++ != 0)
len++;
return len;
+# endif /* ACE_HAS_XPG4_MULTIBYTE_CHAR */
#endif /* ACE_HAS_UNICODE */
}
@@ -7419,12 +7423,16 @@ ACE_OS::strcpy (wchar_t *s, const wchar_t *t)
#if defined (ACE_HAS_UNICODE)
return ::wcscpy (s, t);
#else
+# if defined (ACE_HAS_XPG4_MULTIBYTE_CHAR)
+ return wcscpy (s, t);
+# else
wchar_t *result = s;
while ((*s++ = *t++) != 0)
continue;
return result;
+# endif /* ACE_HAS_XPG4_MULTIBYTE_CHAR */
#endif /* ACE_HAS_UNICODE */
}
diff --git a/ace/README b/ace/README
index 3df26468adc..4214edd26d0 100644
--- a/ace/README
+++ b/ace/README
@@ -119,6 +119,11 @@ ACE_HAS_PTHREAD_T Platform has pthread_t defined.
ACE_HAS_PTHREAD_YIELD_VOIDPTR pthread_yield() takes a void pointer arg.
ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS Platform will recurse infinitely on thread exits from TSS cleanup routines (e.g., AIX).
ACE_HAS_REENTRANT_FUNCTIONS Platform supports reentrant functions (i.e., all the POSIX *_r functions).
+ACE_HAS_XPG4_MULTIBYTE_CHAR Platform has support for multi-byte
+ character support compliant with the
+ XPG4 Worldwide Portability
+ Interface wide-character
+ classification.
ACE_LACKS_FCNTL Platform lacks POSIX-style fcntl ().
ACE_LACKS_FIFO Platform lacks UNIX FIFOs (e.g., Win32)
ACE_LACKS_NETDB_REENTRANT_FUNCTIONS Platform does not support reentrant netdb functions (getprotobyname_r, getprotobynumber_r, gethostbyaddr_r, gethostbyname_r, getservbyname_r).
diff --git a/ace/config-aix-4.2.x.h b/ace/config-aix-4.2.x.h
index 6670975b9df..e79347962da 100644
--- a/ace/config-aix-4.2.x.h
+++ b/ace/config-aix-4.2.x.h
@@ -116,6 +116,8 @@
#define ACE_HAS_UCONTEXT_T
#define ACE_HAS_SIZET_SOCKET_LEN
+// Platform has XPG4 wide character type and functions
+#define ACE_HAS_XPG4_MULTIBYTE_CHAR
// Keep an eye on this as the compiler and standards converge...
#define ACE_LACKS_LINEBUFFERED_STREAMBUF
diff --git a/ace/config-hpux-10.x.h b/ace/config-hpux-10.x.h
index d7b57f4d93a..c5d276c28a0 100644
--- a/ace/config-hpux-10.x.h
+++ b/ace/config-hpux-10.x.h
@@ -123,6 +123,9 @@ extern int h_errno; /* This isn't declared in a header file on HP-UX */
// Platform supports the tid_t type
#define ACE_HAS_TID_T
+// Platform has XPG4 wide character support
+#define ACE_HAS_XPG4_MULTIBYTE_CHAR
+
// Platform lacks readers/writer locks.
#define ACE_LACKS_RWLOCK_T
diff --git a/ace/config-sunos5.5-sunc++-4.x.h b/ace/config-sunos5.5-sunc++-4.x.h
index 0352e236c57..c4180219d2a 100644
--- a/ace/config-sunos5.5-sunc++-4.x.h
+++ b/ace/config-sunos5.5-sunc++-4.x.h
@@ -158,6 +158,9 @@
// Compiler/platform supports sys_siglist array.
#define ACE_HAS_SYS_SIGLIST
+// Platform supports XPG4 wide characters
+#define ACE_HAS_XPG4_MULTIBYTE_CHAR
+
/* Comment out the following eight defines if you want to disable threading. */
// Compile using multi-thread libraries.
#if !defined (ACE_MT_SAFE)