Browse Source

test wstring

David Rose 23 years ago
parent
commit
36bec1e8d7

+ 4 - 0
dtool/Config.Irix.pp

@@ -79,6 +79,10 @@
 // umask?
 #define HAVE_OPEN_MASK 1
 
+// Does <string> define the typedef wstring?  Most do, but for some
+// reason, versions of gcc before 3.0 didn't do this.
+#define HAVE_WSTRING 1
+
 // Do we have <new>?
 #define HAVE_NEW
 

+ 4 - 0
dtool/Config.Linux.pp

@@ -82,6 +82,10 @@
 // umask?  Versions of gcc prior to 3.2 had this.
 #define HAVE_OPEN_MASK
 
+// Does <string> define the typedef wstring?  Most do, but for some
+// reason, versions of gcc before 3.0 didn't do this.
+#define HAVE_WSTRING 1
+
 // Do we have <new>?
 #define HAVE_NEW 1
 

+ 4 - 0
dtool/Config.Win32.pp

@@ -82,6 +82,10 @@
 // umask?
 #define HAVE_OPEN_MASK
 
+// Does <string> define the typedef wstring?  Most do, but for some
+// reason, versions of gcc before 3.0 didn't do this.
+#define HAVE_WSTRING 1
+
 // Do we have <new>?
 #define HAVE_NEW 1
 

+ 3 - 0
dtool/LocalSetup.pp

@@ -137,6 +137,9 @@ $[cdefine HAVE_NAMESPACE]
 /* Define if fstream::open() accepts a third parameter for umask. */
 $[cdefine HAVE_OPEN_MASK]
 
+/* Define if the <string> header file defines wstring. */
+$[cdefine HAVE_WSTRING]
+
 /* Define if the C++ compiler supports the typename keyword.  */
 $[cdefine HAVE_TYPENAME]
 

+ 7 - 2
dtool/src/dtoolbase/dtoolbase_cc.h

@@ -80,10 +80,15 @@ using namespace std;
 #define TYPENAME
 #endif
 
+#ifndef HAVE_WSTRING
+// Some C++ libraries (gcc 2.95) don't define this.
+typedef basic_string<wchar_t> wstring;
+#endif
+
 #ifndef HAVE_STREAMSIZE
-// Some compilers (notably SGI) don't define this for us
+// Some C++ libraries (Irix) don't define this.
 typedef int streamsize;
-#endif /* HAVE_STREAMSIZE */
+#endif
 
 #ifndef HAVE_IOS_TYPEDEFS
 typedef int ios_openmode;