Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix build on big endian architectures.
  • Loading branch information
mat8913 authored and sapier committed Jun 20, 2014
1 parent 2dd69a8 commit ef8cdd8
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/cguittfont/irrUString.h
Expand Up @@ -41,6 +41,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <endian.h>

#ifdef USTRING_CPP0X
# include <utility>
Expand Down Expand Up @@ -806,7 +807,7 @@ class ustring16
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;
Expand All @@ -820,7 +821,7 @@ class ustring16
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;
Expand All @@ -834,7 +835,7 @@ class ustring16
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;
Expand All @@ -849,7 +850,7 @@ class ustring16
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;
Expand All @@ -863,7 +864,7 @@ class ustring16
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;
Expand All @@ -882,7 +883,7 @@ class ustring16
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;
Expand All @@ -897,7 +898,7 @@ class ustring16
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;
Expand All @@ -912,7 +913,7 @@ class ustring16
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;
Expand All @@ -926,7 +927,7 @@ class ustring16
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;
Expand All @@ -940,7 +941,7 @@ class ustring16
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;
Expand All @@ -954,7 +955,7 @@ class ustring16
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;
Expand All @@ -968,7 +969,7 @@ class ustring16
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;
Expand All @@ -982,7 +983,7 @@ class ustring16
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;
Expand All @@ -996,7 +997,7 @@ class ustring16
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;
Expand All @@ -1010,7 +1011,7 @@ class ustring16
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;
Expand All @@ -1029,7 +1030,7 @@ class ustring16
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;
Expand Down

0 comments on commit ef8cdd8

Please sign in to comment.