Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1281)

Unified Diff: third_party/xulrunner-sdk/win/include/xpcom/nsStringAPI.h

Issue 119243: Adding an ifdef that forces wchar_t into PRUint16 temporarily on a nsAString ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/xulrunner-sdk/win/sdk/include/nsStringAPI.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/xulrunner-sdk/win/include/xpcom/nsStringAPI.h
===================================================================
--- third_party/xulrunner-sdk/win/include/xpcom/nsStringAPI.h (revision 17882)
+++ third_party/xulrunner-sdk/win/include/xpcom/nsStringAPI.h (working copy)
@@ -62,6 +62,11 @@
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.
*/
@@ -70,6 +75,9 @@
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 +793,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; }
« no previous file with comments | « no previous file | third_party/xulrunner-sdk/win/sdk/include/nsStringAPI.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698