Index: third_party/xulrunner-sdk/win/sdk/include/nsStringAPI.h |
=================================================================== |
--- third_party/xulrunner-sdk/win/sdk/include/nsStringAPI.h (revision 17882) |
+++ third_party/xulrunner-sdk/win/sdk/include/nsStringAPI.h (working copy) |
@@ -62,14 +62,21 @@ |
typedef PRUint32 size_type; |
typedef PRUint32 index_type; |
+// Force BeginReading into using PRUint16s instead of wchar_t on Windows. |
+// This avoids errors when linking from a project compiled with /Zc:wchar_t. |
+#if defined(WIN32) |
+#define char_type PRUint16 |
+#endif |
/** |
* Returns the length, beginning, and end of a string in one operation. |
*/ |
NS_HIDDEN_(PRUint32) BeginReading(const char_type **begin, |
const char_type **end = nsnull) const; |
- |
NS_HIDDEN_(const char_type*) BeginReading() const; |
NS_HIDDEN_(const char_type*) EndReading() const; |
+#if defined(WIN32) |
+#undef char_type |
+#endif |
NS_HIDDEN_(char_type) CharAt(PRUint32 aPos) const |
{ |
@@ -785,7 +792,11 @@ |
const char_type* get() const |
{ |
+#if defined(WIN32) |
+ return reinterpret_cast<const char_type*>(BeginReading()); |
+#else |
return BeginReading(); |
+#endif |
} |
self_type& operator=(const self_type& aString) { Assign(aString); return *this; } |