Mgfractal: Add 3D and 4D fractals
[oweals/minetest.git] / src / cguittfont / irrUString.h
index 132a35ee2d08962758b55510a36c224094b35fa4..eb7abe5a13d25be685244b7fcca7e82536b0023f 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#ifdef _WIN32
+#define __BYTE_ORDER 0
+#define __LITTLE_ENDIAN 0
+#define __BIG_ENDIAN 1
+#elif defined(__MACH__) && defined(__APPLE__)
+#include <machine/endian.h>
+#elif defined(__FreeBSD__)
+#include <sys/endian.h>
+#else
+#include <endian.h>
+#endif
 
 #ifdef USTRING_CPP0X
 #      include <utility>
@@ -806,7 +817,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 +831,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 +845,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 +860,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 +874,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 +893,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 +908,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 +923,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 +937,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 +951,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 +965,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 +979,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 +993,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 +1007,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 +1021,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 +1040,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;