summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh39
1 files changed, 28 insertions, 11 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh
index 8dcd5aa88f3..f3165121762 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb.hh
@@ -180,7 +180,6 @@
#include <stddef.h>
#include <string.h>
#include <assert.h>
-#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
@@ -242,7 +241,7 @@ extern "C" void hb_free_impl(void *ptr);
#define HB_CONST_FUNC
#define HB_PRINTF_FUNC(format_idx, arg_idx)
#endif
-#if defined(__GNUC__) && (__GNUC__ >= 4)
+#if defined(__GNUC__) && (__GNUC__ >= 4) || (__clang__)
#define HB_UNUSED __attribute__((unused))
#elif defined(_MSC_VER) /* https://github.com/harfbuzz/harfbuzz/issues/635 */
#define HB_UNUSED __pragma(warning(suppress: 4100 4101))
@@ -355,7 +354,7 @@ extern "C" void hb_free_impl(void *ptr);
# endif
# if _WIN32_WCE < 0x800
# define HB_NO_SETLOCALE
-static int errno = 0; /* Use something better? */
+# define HB_NO_ERRNO
# endif
# elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
# ifndef HB_NO_GETENV
@@ -371,6 +370,12 @@ static int errno = 0; /* Use something better? */
#define getenv(Name) nullptr
#endif
+#ifdef HB_NO_ERRNO
+static int errno = 0; /* Use something better? */
+#else
+#include <errno.h>
+#endif
+
#if defined(HAVE_ATEXIT) && !defined(HB_USE_ATEXIT)
/* atexit() is only safe to be called from shared libraries on certain
* platforms. Whitelist.
@@ -475,7 +480,18 @@ static_assert ((sizeof (hb_var_int_t) == 4), "");
/* Size signifying variable-sized array */
-#define VAR 1
+#ifndef HB_VAR_ARRAY
+#define HB_VAR_ARRAY 1
+#endif
+
+static inline double
+_hb_roundf (float x)
+{
+ return x >= 0 ? floor ((double) x + .5) : ceil ((double) x - .5);
+}
+#ifndef HAVE_ROUNDF
+#define roundf(x) _hb_roundf(x)
+#endif
/* Endian swap, used in Windows related backends */
static inline uint16_t hb_uint16_swap (const uint16_t v)
@@ -526,7 +542,7 @@ struct BEInt<Type, 2>
#endif
#endif
return (v[0] << 8)
- + (v[1] );
+ + (v[1] );
}
private: uint8_t v[2];
};
@@ -544,8 +560,8 @@ struct BEInt<Type, 3>
operator Type () const
{
return (v[0] << 16)
- + (v[1] << 8)
- + (v[2] );
+ + (v[1] << 8)
+ + (v[2] );
}
private: uint8_t v[3];
};
@@ -564,9 +580,9 @@ struct BEInt<Type, 4>
operator Type () const
{
return (v[0] << 24)
- + (v[1] << 16)
- + (v[2] << 8)
- + (v[3] );
+ + (v[1] << 16)
+ + (v[2] << 8)
+ + (v[3] );
}
private: uint8_t v[4];
};
@@ -585,9 +601,10 @@ struct BEInt<Type, 4>
* them directly.*/
#include "hb-meta.hh"
#include "hb-mutex.hh"
+#include "hb-number.hh"
#include "hb-atomic.hh" // Requires: hb-meta
#include "hb-null.hh" // Requires: hb-meta
-#include "hb-algs.hh" // Requires: hb-meta hb-null
+#include "hb-algs.hh" // Requires: hb-meta hb-null hb-number
#include "hb-iter.hh" // Requires: hb-algs hb-meta
#include "hb-debug.hh" // Requires: hb-algs hb-atomic
#include "hb-array.hh" // Requires: hb-algs hb-iter hb-null