From 412d6cac3a46d710159ed4b3cc3bb59fd5876d5f Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 16 Sep 2019 13:50:11 +0430 Subject: [PATCH] Extract an avoid errno compile flag --- src/hb-blob.cc | 1 - src/hb-config.hh | 1 + src/hb.hh | 9 +++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hb-blob.cc b/src/hb-blob.cc index 006de7d12..2e72683c8 100644 --- a/src/hb-blob.cc +++ b/src/hb-blob.cc @@ -48,7 +48,6 @@ #endif /* HAVE_SYS_MMAN_H */ #include -#include #include diff --git a/src/hb-config.hh b/src/hb-config.hh index b6db206a3..14c539595 100644 --- a/src/hb-config.hh +++ b/src/hb-config.hh @@ -58,6 +58,7 @@ #define HB_NO_BITMAP #define HB_NO_CFF #define HB_NO_COLOR +#define HB_NO_ERRNO #define HB_NO_FACE_COLLECT_UNICODES #define HB_NO_GETENV #define HB_NO_HINTING diff --git a/src/hb.hh b/src/hb.hh index 36eff1717..5934688d4 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -180,7 +180,6 @@ #include #include #include -#include #include #include @@ -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 +#endif + #if defined(HAVE_ATEXIT) && !defined(HB_USE_ATEXIT) /* atexit() is only safe to be called from shared libraries on certain * platforms. Whitelist.