From e832dc4c642f604d2cbb8e6b2f0b8d37151936f1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 28 Oct 2019 17:02:40 -0700 Subject: [PATCH] [config] Make HB_NO_ERRNO work with systems defining errno as a macro --- src/hb.hh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hb.hh b/src/hb.hh index f31651217..f6398ccef 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -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 #else -#include +static int _hb_errno = 0; /* Use something better? */ +# undef errno +# define errno _hb_errno #endif #if defined(HAVE_ATEXIT) && !defined(HB_USE_ATEXIT)