Extract an avoid errno compile flag

This commit is contained in:
Ebrahim Byagowi 2019-09-16 13:50:11 +04:30
parent 8a16d6f1c1
commit 412d6cac3a
3 changed files with 8 additions and 3 deletions

View File

@ -48,7 +48,6 @@
#endif /* HAVE_SYS_MMAN_H */
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>

View File

@ -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

View File

@ -180,7 +180,6 @@
#include <stddef.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
@ -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.