[config] Make HB_NO_ERRNO work with systems defining errno as a macro

This commit is contained in:
Behdad Esfahbod 2019-10-28 17:02:40 -07:00
parent ce11df1b5b
commit e832dc4c64
1 changed files with 5 additions and 3 deletions

View File

@ -370,10 +370,12 @@ extern "C" void hb_free_impl(void *ptr);
#define getenv(Name) nullptr
#endif
#ifdef HB_NO_ERRNO
static int errno = 0; /* Use something better? */
#ifndef HB_NO_ERRNO
# include <errno.h>
#else
#include <errno.h>
static int _hb_errno = 0; /* Use something better? */
# undef errno
# define errno _hb_errno
#endif
#if defined(HAVE_ATEXIT) && !defined(HB_USE_ATEXIT)