From 2084922e5ca72b9dfc7a654372c8895e7f81fa10 Mon Sep 17 00:00:00 2001 From: "kherron@fmailbox.com" Date: Sat, 16 Jun 2007 13:02:15 -0700 Subject: [PATCH] Bug 177150 - Some mozilla-config.h defines require additional cflags for embedders. Patch by . r=benjamin, sr=dbaron. --- xpcom/glue/nsStringAPI.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xpcom/glue/nsStringAPI.h b/xpcom/glue/nsStringAPI.h index 0431eb3f11e..176dbc11057 100644 --- a/xpcom/glue/nsStringAPI.h +++ b/xpcom/glue/nsStringAPI.h @@ -51,6 +51,7 @@ #include "nsXPCOMStrings.h" #include "nsISupportsImpl.h" +#include "prlog.h" class nsAString { @@ -949,6 +950,7 @@ private: */ #ifdef HAVE_CPP_2BYTE_WCHAR_T + PR_STATIC_ASSERT(sizeof(wchar_t) == 2); #define NS_LL(s) L##s #define NS_MULTILINE_LITERAL_STRING(s) nsDependentString(NS_REINTERPRET_CAST(const nsAString::char_type*, s), PRUint32((sizeof(s)/sizeof(wchar_t))-1)) #define NS_MULTILINE_LITERAL_STRING_INIT(n,s) n(NS_REINTERPRET_CAST(const nsAString::char_type*, s), PRUint32((sizeof(s)/sizeof(wchar_t))-1)) @@ -962,6 +964,9 @@ private: typedef NS_ConvertASCIItoUTF16 nsLiteralString; #endif +/* Check that PRUnichar is unsigned */ +PR_STATIC_ASSERT(PRUnichar(-1) > PRUnichar(0)); + /* * Macro arguments used in concatenation or stringification won't be expanded. * Therefore, in order for |NS_L(FOO)| to work as expected (which is to expand