diff options
Diffstat (limited to 'meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Do-build-time-detection-of-2-bytes-wchar_t-and-char1.patch')
-rw-r--r-- | meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Do-build-time-detection-of-2-bytes-wchar_t-and-char1.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Do-build-time-detection-of-2-bytes-wchar_t-and-char1.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Do-build-time-detection-of-2-bytes-wchar_t-and-char1.patch new file mode 100644 index 00000000..99408b4d --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Do-build-time-detection-of-2-bytes-wchar_t-and-char1.patch @@ -0,0 +1,69 @@ +From: Mike Hommey <glandium@debian.org> +Date: Wed, 14 Apr 2010 08:59:59 +0200 +Subject: Do build time detection of 2-bytes wchar_t and char16_t support + +https://bugzilla.mozilla.org/show_bug.cgi?id=559278 +Closes: #577677 +--- + xpcom/base/nscore.h | 22 ++++++++++++++++++++++ + xpcom/glue/nsStringAPI.h | 1 + + xpcom/string/public/nsLiteralString.h | 1 + + 3 files changed, 24 insertions(+) + +diff --git a/xpcom/base/nscore.h b/xpcom/base/nscore.h +index 9cde77d..40d3aaa 100644 +--- a/xpcom/base/nscore.h ++++ b/xpcom/base/nscore.h +@@ -391,6 +391,28 @@ typedef PRUint32 nsrefcnt; + #define HAVE_CPP_2BYTE_WCHAR_T + #endif + ++#ifdef __GNUC__ ++/* char16_t is only available in gcc 4.4+ with experimental c++0x support ++ * (-std=c++0x or -std=gnu++0x) */ ++#if defined(HAVE_CPP_CHAR16_T) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)) ++#warning libxul SDK was configured with char16_t support, but now building without ++#undef HAVE_CPP_CHAR16_T ++#elif ! defined(HAVE_CPP_CHAR16_T) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && defined(__GXX_EXPERIMENTAL_CXX0X__) ++#warning libxul SDK was configured without char16_t support, but now building with ++#define HAVE_CPP_CHAR16_T ++#endif ++ ++/* When gcc is not given -fshort-wchar, wchar_t is not 2-bytes wide */ ++#if defined(HAVE_CPP_2BYTE_WCHAR_T) && (__SIZEOF_WCHAR_T__ != 2) ++#warning libxul SDK was configured with 2-byte wchar_t, but now building without ++#undef HAVE_CPP_2BYTE_WCHAR_T ++#elif ! defined(HAVE_CPP_2BYTE_WCHAR_T) && (__SIZEOF_WCHAR_T__ == 2) ++#warning libxul SDK was configured without 2-byte wchar_t, but now building with ++#define HAVE_CPP_2BYTE_WCHAR_T ++#endif ++ ++#endif ++ + #ifndef __PRUNICHAR__ + #define __PRUNICHAR__ + /* For now, don't use wchar_t on Unix because it breaks the Netscape +diff --git a/xpcom/glue/nsStringAPI.h b/xpcom/glue/nsStringAPI.h +index 272c9eb..0590fc5 100644 +--- a/xpcom/glue/nsStringAPI.h ++++ b/xpcom/glue/nsStringAPI.h +@@ -1109,6 +1109,7 @@ private: + #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 ++ #warning Using conversions for literal strings. Please consider using 2-bytes wchar_t or char16_t instead + #define NS_LL(s) s + #define NS_MULTILINE_LITERAL_STRING(s) NS_ConvertASCIItoUTF16(s, PRUint32(sizeof(s)-1)) + #define NS_MULTILINE_LITERAL_STRING_INIT(n,s) n(s, PRUint32(sizeof(s)-1)) +diff --git a/xpcom/string/public/nsLiteralString.h b/xpcom/string/public/nsLiteralString.h +index 7808f24..2cf1f7b 100644 +--- a/xpcom/string/public/nsLiteralString.h ++++ b/xpcom/string/public/nsLiteralString.h +@@ -91,6 +91,7 @@ literal_string( const nsACString::char_type* aPtr, PRUint32 aLength ) + #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 ++ #warning Using conversions for literal strings. Please consider using 2-bytes wchar_t or char16_t instead + #define NS_LL(s) s + #define NS_MULTILINE_LITERAL_STRING(s) NS_ConvertASCIItoUTF16(s, PRUint32(sizeof(s)-1)) + #define NS_MULTILINE_LITERAL_STRING_INIT(n,s) n(s, PRUint32(sizeof(s)-1)) |