svn commit: r205954 - head/include

Juli Mallett jmallett at FreeBSD.org
Wed Mar 31 02:12:24 UTC 2010


Author: jmallett
Date: Wed Mar 31 02:12:24 2010
New Revision: 205954
URL: http://svn.freebsd.org/changeset/base/205954

Log:
  Be like stdlib.h and bring in a wchar_t definition and use it to prototype
  wcstoimax and wcstoumax, rather than spelling it __wchar_t.  This is necessary
  to use these functions in C++ where wchar_t is different to __wchar_t and is
  a built-in type.
  
  It may be better to use __wchar_t here and to simply define __wchar_t as being
  wchar_t in C++ mode rather than to bring in wchar_t, but this is less invasive
  and follows our existing practice, and restores wchar_t usage in this file to
  what it was before r1.8.

Modified:
  head/include/inttypes.h

Modified: head/include/inttypes.h
==============================================================================
--- head/include/inttypes.h	Wed Mar 31 01:51:08 2010	(r205953)
+++ head/include/inttypes.h	Wed Mar 31 02:12:24 2010	(r205954)
@@ -32,6 +32,13 @@
 #include <machine/_inttypes.h>
 #include <sys/stdint.h>
 
+#ifndef	__cplusplus
+#ifndef _WCHAR_T_DECLARED
+typedef	__wchar_t	wchar_t;
+#define	_WCHAR_T_DECLARED
+#endif
+#endif
+
 typedef struct {
 	intmax_t	quot;		/* Quotient. */
 	intmax_t	rem;		/* Remainder. */
@@ -43,10 +50,10 @@ imaxdiv_t	imaxdiv(intmax_t, intmax_t) __
 
 intmax_t	strtoimax(const char * __restrict, char ** __restrict, int);
 uintmax_t	strtoumax(const char * __restrict, char ** __restrict, int);
-intmax_t	wcstoimax(const __wchar_t * __restrict,
-		    __wchar_t ** __restrict, int);
-uintmax_t	wcstoumax(const __wchar_t * __restrict,
-		    __wchar_t ** __restrict, int);
+intmax_t	wcstoimax(const wchar_t * __restrict,
+		    wchar_t ** __restrict, int);
+uintmax_t	wcstoumax(const wchar_t * __restrict,
+		    wchar_t ** __restrict, int);
 __END_DECLS
 
 #endif /* !_INTTYPES_H_ */


More information about the svn-src-all mailing list