41
41
#include < stdio.h>
42
42
#include < string.h>
43
43
#include < stdlib.h>
44
+ #include < endian.h>
44
45
45
46
#ifdef USTRING_CPP0X
46
47
# include < utility>
@@ -806,7 +807,7 @@ class ustring16
806
807
ustring16 ()
807
808
: array(0 ), allocated(1 ), used(0 )
808
809
{
809
- #if __BIG_ENDIAN__
810
+ #if __BYTE_ORDER == __BIG_ENDIAN
810
811
encoding = unicode::EUTFE_UTF16_BE;
811
812
#else
812
813
encoding = unicode::EUTFE_UTF16_LE;
@@ -820,7 +821,7 @@ class ustring16
820
821
ustring16 (const ustring16<TAlloc>& other)
821
822
: array(0 ), allocated(0 ), used(0 )
822
823
{
823
- #if __BIG_ENDIAN__
824
+ #if __BYTE_ORDER == __BIG_ENDIAN
824
825
encoding = unicode::EUTFE_UTF16_BE;
825
826
#else
826
827
encoding = unicode::EUTFE_UTF16_LE;
@@ -834,7 +835,7 @@ class ustring16
834
835
ustring16 (const string<B, A>& other)
835
836
: array(0 ), allocated(0 ), used(0 )
836
837
{
837
- #if __BIG_ENDIAN__
838
+ #if __BYTE_ORDER == __BIG_ENDIAN
838
839
encoding = unicode::EUTFE_UTF16_BE;
839
840
#else
840
841
encoding = unicode::EUTFE_UTF16_LE;
@@ -849,7 +850,7 @@ class ustring16
849
850
ustring16 (const std::basic_string<B, A, Alloc>& other)
850
851
: array(0 ), allocated(0 ), used(0 )
851
852
{
852
- #if __BIG_ENDIAN__
853
+ #if __BYTE_ORDER == __BIG_ENDIAN
853
854
encoding = unicode::EUTFE_UTF16_BE;
854
855
#else
855
856
encoding = unicode::EUTFE_UTF16_LE;
@@ -863,7 +864,7 @@ class ustring16
863
864
ustring16 (Itr first, Itr last)
864
865
: array(0 ), allocated(0 ), used(0 )
865
866
{
866
- #if __BIG_ENDIAN__
867
+ #if __BYTE_ORDER == __BIG_ENDIAN
867
868
encoding = unicode::EUTFE_UTF16_BE;
868
869
#else
869
870
encoding = unicode::EUTFE_UTF16_LE;
@@ -882,7 +883,7 @@ class ustring16
882
883
ustring16 (const char * const c)
883
884
: array(0 ), allocated(0 ), used(0 )
884
885
{
885
- #if __BIG_ENDIAN__
886
+ #if __BYTE_ORDER == __BIG_ENDIAN
886
887
encoding = unicode::EUTFE_UTF16_BE;
887
888
#else
888
889
encoding = unicode::EUTFE_UTF16_LE;
@@ -897,7 +898,7 @@ class ustring16
897
898
ustring16 (const char * const c, u32 length)
898
899
: array(0 ), allocated(0 ), used(0 )
899
900
{
900
- #if __BIG_ENDIAN__
901
+ #if __BYTE_ORDER == __BIG_ENDIAN
901
902
encoding = unicode::EUTFE_UTF16_BE;
902
903
#else
903
904
encoding = unicode::EUTFE_UTF16_LE;
@@ -912,7 +913,7 @@ class ustring16
912
913
ustring16 (const uchar8_t * const c)
913
914
: array(0 ), allocated(0 ), used(0 )
914
915
{
915
- #if __BIG_ENDIAN__
916
+ #if __BYTE_ORDER == __BIG_ENDIAN
916
917
encoding = unicode::EUTFE_UTF16_BE;
917
918
#else
918
919
encoding = unicode::EUTFE_UTF16_LE;
@@ -926,7 +927,7 @@ class ustring16
926
927
ustring16 (const char c)
927
928
: array(0 ), allocated(0 ), used(0 )
928
929
{
929
- #if __BIG_ENDIAN__
930
+ #if __BYTE_ORDER == __BIG_ENDIAN
930
931
encoding = unicode::EUTFE_UTF16_BE;
931
932
#else
932
933
encoding = unicode::EUTFE_UTF16_LE;
@@ -940,7 +941,7 @@ class ustring16
940
941
ustring16 (const uchar8_t * const c, u32 length)
941
942
: array(0 ), allocated(0 ), used(0 )
942
943
{
943
- #if __BIG_ENDIAN__
944
+ #if __BYTE_ORDER == __BIG_ENDIAN
944
945
encoding = unicode::EUTFE_UTF16_BE;
945
946
#else
946
947
encoding = unicode::EUTFE_UTF16_LE;
@@ -954,7 +955,7 @@ class ustring16
954
955
ustring16 (const uchar16_t * const c)
955
956
: array(0 ), allocated(0 ), used(0 )
956
957
{
957
- #if __BIG_ENDIAN__
958
+ #if __BYTE_ORDER == __BIG_ENDIAN
958
959
encoding = unicode::EUTFE_UTF16_BE;
959
960
#else
960
961
encoding = unicode::EUTFE_UTF16_LE;
@@ -968,7 +969,7 @@ class ustring16
968
969
ustring16 (const uchar16_t * const c, u32 length)
969
970
: array(0 ), allocated(0 ), used(0 )
970
971
{
971
- #if __BIG_ENDIAN__
972
+ #if __BYTE_ORDER == __BIG_ENDIAN
972
973
encoding = unicode::EUTFE_UTF16_BE;
973
974
#else
974
975
encoding = unicode::EUTFE_UTF16_LE;
@@ -982,7 +983,7 @@ class ustring16
982
983
ustring16 (const uchar32_t * const c)
983
984
: array(0 ), allocated(0 ), used(0 )
984
985
{
985
- #if __BIG_ENDIAN__
986
+ #if __BYTE_ORDER == __BIG_ENDIAN
986
987
encoding = unicode::EUTFE_UTF16_BE;
987
988
#else
988
989
encoding = unicode::EUTFE_UTF16_LE;
@@ -996,7 +997,7 @@ class ustring16
996
997
ustring16 (const uchar32_t * const c, u32 length)
997
998
: array(0 ), allocated(0 ), used(0 )
998
999
{
999
- #if __BIG_ENDIAN__
1000
+ #if __BYTE_ORDER == __BIG_ENDIAN
1000
1001
encoding = unicode::EUTFE_UTF16_BE;
1001
1002
#else
1002
1003
encoding = unicode::EUTFE_UTF16_LE;
@@ -1010,7 +1011,7 @@ class ustring16
1010
1011
ustring16 (const wchar_t * const c)
1011
1012
: array(0 ), allocated(0 ), used(0 )
1012
1013
{
1013
- #if __BIG_ENDIAN__
1014
+ #if __BYTE_ORDER == __BIG_ENDIAN
1014
1015
encoding = unicode::EUTFE_UTF16_BE;
1015
1016
#else
1016
1017
encoding = unicode::EUTFE_UTF16_LE;
@@ -1029,7 +1030,7 @@ class ustring16
1029
1030
ustring16 (const wchar_t * const c, u32 length)
1030
1031
: array(0 ), allocated(0 ), used(0 )
1031
1032
{
1032
- #if __BIG_ENDIAN__
1033
+ #if __BYTE_ORDER == __BIG_ENDIAN
1033
1034
encoding = unicode::EUTFE_UTF16_BE;
1034
1035
#else
1035
1036
encoding = unicode::EUTFE_UTF16_LE;
0 commit comments