From 849f2b28120b9e8cea982e4027066cb967ad5583 Mon Sep 17 00:00:00 2001 From: Steve Huston Date: Mon, 10 Nov 1997 20:08:51 +0000 Subject: Added new macro ACE_HAS_XPG4_MULTIBYTE_CHAR for platforms that provide wchar.h and associated wide character functions. --- ace/OS.h | 6 +++++- ace/OS.i | 8 ++++++++ ace/README | 5 +++++ ace/config-aix-4.2.x.h | 2 ++ ace/config-hpux-10.x.h | 3 +++ ace/config-sunos5.5-sunc++-4.x.h | 3 +++ 6 files changed, 26 insertions(+), 1 deletion(-) (limited to 'ace') 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 /**/ # endif /* ACE_HAS_STANDARD_CPP_LIBRARY */ #else -typedef long wchar_t; +# if defined (ACE_HAS_XPG4_MULTIBYTE_CHAR) +# include /**/ +# 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) -- cgit v1.2.1