stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r368468 - in /incubator/stdcxx/trunk/include: ansi/_cwchar.h rw/_mbstate.h
Date Thu, 12 Jan 2006 21:07:57 GMT
Author: sebor
Date: Thu Jan 12 13:07:51 2006
New Revision: 368468

URL: http://svn.apache.org/viewcvs?rev=368468&view=rev
Log:
2006-01-12  Martin Sebor  <sebor@roguewave.com>
	
	* _mbstate.h (__rw_mbstate_t) [_RWSTD_OS_AIX]: Introduced typedef
	to avoid problems due to const qualification on _RWSTD_MBSTATE_T.
	(<machine/_types.h>) [_RWSTD_OS_DARWIN]: Included for __mbstate_t.
	(_RWSTD_MBSTATE_T): Defined to std::mbstate_t for the generic OS.
	* _cwchar.h (mbstate_t): Defined in terms of _RWSTD_MBSTATE_T.

Modified:
    incubator/stdcxx/trunk/include/ansi/_cwchar.h
    incubator/stdcxx/trunk/include/rw/_mbstate.h

Modified: incubator/stdcxx/trunk/include/ansi/_cwchar.h
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/ansi/_cwchar.h?rev=368468&r1=368467&r2=368468&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/ansi/_cwchar.h (original)
+++ incubator/stdcxx/trunk/include/ansi/_cwchar.h Thu Jan 12 13:07:51 2006
@@ -3,7 +3,7 @@
  *
  * cwchar - C++ Standard library interface to the ANSI C header wchar.h
  *
- * $Id: //stdlib/dev/include/ansi/_cwchar.h#22 $
+ * $Id$
  *
  ***************************************************************************
  *
@@ -24,11 +24,11 @@
 #define _RWSTD_CWCHAR_H_INCLUDED
 
 
-#include <rw/_mbstate.h>
+#include <rw/_mbstate.h>   // for _RWSTD_MBSTATE_T
 #include <rw/_defs.h>
 
 
-_RWSTD_NAMESPACE (std) { 
+_RWSTD_NAMESPACE (std) {
 
 
 #ifndef NULL
@@ -43,6 +43,9 @@
 
 extern "C" {
 
+// _RWSTD_MBSTATE_T is defined in <rw/_mbstate.h>
+typedef _RWSTD_MBSTATE_T mbstate_t;
+
 struct tm;
 
 #ifndef WCHAR_MIN
@@ -63,6 +66,7 @@
 typedef int wint_t;
 #endif   // _RWSTD_NO_WINT_T
 
+// declared, not defined (FILE need not be a complete type)
 struct FILE;
 
 int fwprintf (FILE*, const wchar_t*, ...);

Modified: incubator/stdcxx/trunk/include/rw/_mbstate.h
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/rw/_mbstate.h?rev=368468&r1=368467&r2=368468&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/rw/_mbstate.h (original)
+++ incubator/stdcxx/trunk/include/rw/_mbstate.h Thu Jan 12 13:07:51 2006
@@ -29,13 +29,20 @@
 #include <rw/_defs.h>
 
 
-/*** AIX ******************************************************************/
 #if defined (_RWSTD_OS_AIX)
+/*** AIX ******************************************************************/
 
-#  define _RWSTD_MBSTATE_T   char*
+_RWSTD_NAMESPACE (__rw) {
+
+// introduce typedef to avoid const qualification issues
+typedef char* __rw_mbstate_t;
+
+#  define _RWSTD_MBSTATE_T   _RW::__rw_mbstate_t
+
+}   // namespace __rw
 
-/*** HP-UX ****************************************************************/
 #elif defined (_RWSTD_OS_HP_UX)
+/*** HP-UX ****************************************************************/
 
 #  ifndef _MBSTATE_T
 #    define _MBSTATE_T
@@ -93,20 +100,21 @@
 #    endif   // _NAMESPACE_STD
 #  endif   // _MBSTATE_T
 
-/*** IRIX64 ***************************************************************/
 #elif defined (_RWSTD_OS_IRIX64)
+/*** IRIX64 ***************************************************************/
 
 #  define _RWSTD_MBSTATE_T char
 
-/*** MSVC 6.0 - 8.0 *******************************************************/
 #elif defined (_MSC_VER)
+/*** MSVC 6.0 - 8.0 *******************************************************/
 
 #  define _RWSTD_MBSTATE_T int
 
-/*** not HP-UX that has a mbstate_t ***************************************/
 #elif !defined (_RWSTD_NO_MBSTATE_T)
+/*** not HP-UX that has a mbstate_t ***************************************/
 
 #  if defined (_RWSTD_OS_LINUX)
+/*** Linux/glibc **********************************************************/
 
      // define __mbstate_t at file scope (see /usr/include/wchar.h)
 #    ifndef __mbstate_t_defined
@@ -129,6 +137,7 @@
 #    define _RWSTD_MBSTATE_T __mbstate_t
 
 #  elif defined (_RWSTD_OS_SUNOS)
+/*** Solaris 7 and beyond *************************************************/
 
 #    ifndef _MBSTATET_H
 #      define _MBSTATET_H
@@ -151,8 +160,19 @@
 
 #    define _RWSTD_MBSTATE_T __mbstate_t
 
+#  elif defined (_RWSTD_OS_DARWIN)
+/*** Apple Darwin/OS X ****************************************************/
+
+     // include a system header for __mbstate_t
+#    include <machine/_types.h>
+#    define _RWSTD_MBSTATE_T   __mbstate_t
+
 #  else   // if !defined (_RWSTD_OS_SUNOS)
+/*** generic OS ***********************************************************/
+     
 #    include _RWSTD_CWCHAR
+#    define _RWSTD_MBSTATE_T   _RWSTD_C::mbstate_t
+
 #  endif   // _RWSTD_OS_SUNOS
 
 /*** not HP-UX that does not define mbstate_t *****************************/
@@ -160,7 +180,8 @@
 
 #  define _RWSTD_MBSTATE_T_DEFINED
 
-#  if defined (_RWSTD_OS_SUNOS)   // SunOS 5.6
+/*** SunOS 5.6 and prior **************************************************/
+#  if defined (_RWSTD_OS_SUNOS)
 
 // Solaris 6 does not define mbstate_t; the definition of
 // the struct below is taken from <wchar_impl.h> on Solaris 7



Mime
View raw message