Possible partial compile fix for linux/mac

Fri, 16 Mar 2012 22:53:36 -0700

author
Tank_Master
date
Fri, 16 Mar 2012 22:53:36 -0700
changeset 1679
255e9ae0729f
parent 1678
b57fd851894d
child 1680
f70b0f60e3bb

Possible partial compile fix for linux/mac

indra/llcommon/llstring.cpp file | annotate | diff | revisions
indra/llcommon/llstring.h file | annotate | diff | revisions
     1.1 --- a/indra/llcommon/llstring.cpp	Thu Mar 15 11:32:30 2012 -0700
     1.2 +++ b/indra/llcommon/llstring.cpp	Fri Mar 16 22:53:36 2012 -0700
     1.3 @@ -179,10 +179,10 @@
     1.4  	return outchars - base;
     1.5  }	
     1.6  
     1.7 -S32 utf16chars_to_wchar(const wchar_t* inchars, llwchar* outchar)
     1.8 +S32 utf16chars_to_wchar(const U16* inchars, llwchar* outchar)
     1.9  {
    1.10 -	const wchar_t* base = inchars;
    1.11 -	wchar_t cur_char = *inchars++;
    1.12 +	const U16* base = inchars;
    1.13 +	U16 cur_char = *inchars++;
    1.14  	llwchar char32 = cur_char;
    1.15  	if ((cur_char >= 0xD800) && (cur_char <= 0xDFFF))
    1.16  	{
    1.17 @@ -241,7 +241,7 @@
    1.18  
    1.19  	S32 i = 0;
    1.20  	// craziness to make gcc happy (llutf16string.c_str() is tweaked on linux):
    1.21 -	const wchar_t* chars16 = &(*(utf16str.begin()));
    1.22 +	const U16* chars16 = &(*(utf16str.begin()));
    1.23  	while (i < len)
    1.24  	{
    1.25  		llwchar cur_char;
    1.26 @@ -262,18 +262,18 @@
    1.27  {
    1.28  	S32 surrogate_pairs = 0;
    1.29  	// ... craziness to make gcc happy (llutf16string.c_str() is tweaked on linux):
    1.30 -	const wchar_t *const utf16_chars = &(*(utf16str.begin()));
    1.31 +	const U16 *const utf16_chars = &(*(utf16str.begin()));
    1.32  	S32 i = 0;
    1.33  	while (i < utf16_len)
    1.34  	{
    1.35 -		const wchar_t c = utf16_chars[i++];
    1.36 +		const U16 c = utf16_chars[i++];
    1.37  		if (c >= 0xD800 && c <= 0xDBFF)		// See http://en.wikipedia.org/wiki/UTF-16
    1.38  		{   // Have first byte of a surrogate pair
    1.39  			if (i >= utf16_len)
    1.40  			{
    1.41  				break;
    1.42  			}
    1.43 -			const wchar_t d = utf16_chars[i];
    1.44 +			const U16 d = utf16_chars[i];
    1.45  			if (d >= 0xDC00 && d <= 0xDFFF)
    1.46  			{   // Have valid second byte of a surrogate pair
    1.47  				surrogate_pairs++;
     2.1 --- a/indra/llcommon/llstring.h	Thu Mar 15 11:32:30 2012 -0700
     2.2 +++ b/indra/llcommon/llstring.h	Fri Mar 16 22:53:36 2012 -0700
     2.3 @@ -448,7 +448,7 @@
     2.4  //
     2.5  // We should never use UTF16 except when communicating with Win32!
     2.6  //
     2.7 -typedef std::basic_string<wchar_t> llutf16string;
     2.8 +typedef std::basic_string<U16> llutf16string;
     2.9  
    2.10  LL_COMMON_API LLWString utf16str_to_wstring(const llutf16string &utf16str, S32 len);
    2.11  LL_COMMON_API LLWString utf16str_to_wstring(const llutf16string &utf16str);

mercurial