Use char16_t when available, and when it is, don't test for -fshort-wchar. (Bug 502298) r=bsmedberg
This commit is contained in:
@@ -1050,12 +1050,17 @@ private:
|
||||
* Under GCC, this define should only be set if compiling with -fshort-wchar.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CPP_2BYTE_WCHAR_T
|
||||
#if defined(HAVE_CPP_CHAR16_T) || defined(HAVE_CPP_2BYTE_WCHAR_T)
|
||||
#if defined(HAVE_CPP_CHAR16_T)
|
||||
PR_STATIC_ASSERT(sizeof(char16_t) == 2);
|
||||
#define NS_LL(s) u##s
|
||||
#else
|
||||
PR_STATIC_ASSERT(sizeof(wchar_t) == 2);
|
||||
#define NS_LL(s) L##s
|
||||
#define NS_MULTILINE_LITERAL_STRING(s) nsDependentString(reinterpret_cast<const nsAString::char_type*>(s), PRUint32((sizeof(s)/sizeof(wchar_t))-1))
|
||||
#define NS_MULTILINE_LITERAL_STRING_INIT(n,s) n(reinterpret_cast<const nsAString::char_type*>(s), PRUint32((sizeof(s)/sizeof(wchar_t))-1))
|
||||
#define NS_NAMED_MULTILINE_LITERAL_STRING(n,s) const nsDependentString n(reinterpret_cast<const nsAString::char_type*>(s), PRUint32((sizeof(s)/sizeof(wchar_t))-1))
|
||||
#endif
|
||||
#define NS_MULTILINE_LITERAL_STRING(s) nsDependentString(reinterpret_cast<const nsAString::char_type*>(s), PRUint32((sizeof(s)/2)-1))
|
||||
#define NS_MULTILINE_LITERAL_STRING_INIT(n,s) n(reinterpret_cast<const nsAString::char_type*>(s), PRUint32((sizeof(s)/2)-1))
|
||||
#define NS_NAMED_MULTILINE_LITERAL_STRING(n,s) const nsDependentString n(reinterpret_cast<const nsAString::char_type*>(s), PRUint32((sizeof(s)/2)-1))
|
||||
typedef nsDependentString nsLiteralString;
|
||||
#else
|
||||
#define NS_LL(s) s
|
||||
|
||||
Reference in New Issue
Block a user