Fix compilation with -DUSE_FRIBIDI=0

This commit is contained in:
Nado 2015-04-23 19:55:12 +02:00
parent 959c86d816
commit 76270ce0ec

View File

@ -96,6 +96,7 @@ wchar_t* utf8_to_wide(const char* input)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/** Frees the memory allocated for the result of toFribidiChar(). */ /** Frees the memory allocated for the result of toFribidiChar(). */
#ifdef ENABLE_BIDI
void freeFribidiChar(FriBidiChar *str) void freeFribidiChar(FriBidiChar *str)
{ {
#ifdef TEST_BIDI #ifdef TEST_BIDI
@ -105,13 +106,16 @@ void freeFribidiChar(FriBidiChar *str)
delete[] str; delete[] str;
#endif #endif
} }
#endif
/** Frees the memory allocated for the result of fromFribidiChar(). */ /** Frees the memory allocated for the result of fromFribidiChar(). */
#ifdef ENABLE_BIDI
void freeFribidiChar(wchar_t *str) void freeFribidiChar(wchar_t *str)
{ {
if (sizeof(wchar_t) != sizeof(FriBidiChar)) if (sizeof(wchar_t) != sizeof(FriBidiChar))
delete[] str; delete[] str;
} }
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/** Converts a wstring to a FriBidi-string. /** Converts a wstring to a FriBidi-string.
@ -121,6 +125,7 @@ void freeFribidiChar(wchar_t *str)
On linux, the string doesn't need to be converted because wchar_t is On linux, the string doesn't need to be converted because wchar_t is
already UTF-32. On windows the string is converted from UTF-16 by this already UTF-32. On windows the string is converted from UTF-16 by this
function. */ function. */
#ifdef ENABLE_BIDI
FriBidiChar* toFribidiChar(const wchar_t* str) FriBidiChar* toFribidiChar(const wchar_t* str)
{ {
std::size_t length = wcslen(str); std::size_t length = wcslen(str);
@ -168,6 +173,7 @@ wchar_t* fromFribidiChar(const FriBidiChar* str)
} }
return result; return result;
} }
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
Translations::Translations() //: m_dictionary_manager("UTF-16") Translations::Translations() //: m_dictionary_manager("UTF-16")