diff options
author | Matthew Bekkema <mbekkema97@gmail.com> | 2014-06-20 17:33:28 +1000 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2014-06-20 18:40:06 +0200 |
commit | ef8cdd890cd36b1fde54b44e125edf7603821a53 (patch) | |
tree | 9dc42f12df064293cb1917b7d961cd405f783288 /src/cguittfont | |
parent | 2dd69a85e71da15a58e59e12d5e986a617429c8f (diff) | |
download | minetest-ef8cdd890cd36b1fde54b44e125edf7603821a53.tar.gz minetest-ef8cdd890cd36b1fde54b44e125edf7603821a53.tar.bz2 minetest-ef8cdd890cd36b1fde54b44e125edf7603821a53.zip |
Fix build on big endian architectures.
Diffstat (limited to 'src/cguittfont')
-rw-r--r-- | src/cguittfont/irrUString.h | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/cguittfont/irrUString.h b/src/cguittfont/irrUString.h index 132a35ee2..094944520 100644 --- a/src/cguittfont/irrUString.h +++ b/src/cguittfont/irrUString.h @@ -41,6 +41,7 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> +#include <endian.h> #ifdef USTRING_CPP0X # include <utility> @@ -806,7 +807,7 @@ public: ustring16() : array(0), allocated(1), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -820,7 +821,7 @@ public: ustring16(const ustring16<TAlloc>& other) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -834,7 +835,7 @@ public: ustring16(const string<B, A>& other) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -849,7 +850,7 @@ public: ustring16(const std::basic_string<B, A, Alloc>& other) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -863,7 +864,7 @@ public: ustring16(Itr first, Itr last) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -882,7 +883,7 @@ public: ustring16(const char* const c) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -897,7 +898,7 @@ public: ustring16(const char* const c, u32 length) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -912,7 +913,7 @@ public: ustring16(const uchar8_t* const c) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -926,7 +927,7 @@ public: ustring16(const char c) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -940,7 +941,7 @@ public: ustring16(const uchar8_t* const c, u32 length) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -954,7 +955,7 @@ public: ustring16(const uchar16_t* const c) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -968,7 +969,7 @@ public: ustring16(const uchar16_t* const c, u32 length) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -982,7 +983,7 @@ public: ustring16(const uchar32_t* const c) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -996,7 +997,7 @@ public: ustring16(const uchar32_t* const c, u32 length) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -1010,7 +1011,7 @@ public: ustring16(const wchar_t* const c) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; @@ -1029,7 +1030,7 @@ public: ustring16(const wchar_t* const c, u32 length) : array(0), allocated(0), used(0) { -#if __BIG_ENDIAN__ +#if __BYTE_ORDER == __BIG_ENDIAN encoding = unicode::EUTFE_UTF16_BE; #else encoding = unicode::EUTFE_UTF16_LE; |