Add configuration option HB_NO_GETENV to disable use of getenv()

This commit is contained in:
Cody Planteen 2019-05-02 13:03:15 -06:00 committed by Behdad Esfahbod
parent c7f366fbbb
commit 72e3eba8f8

View File

@ -343,19 +343,27 @@ extern "C" int hb_memalign_impl(void **memptr, size_t alignment, size_t size);
# if defined(_WIN32_WCE)
/* Some things not defined on Windows CE. */
# define vsnprintf _vsnprintf
# define getenv(Name) nullptr
# ifndef HB_NO_GETENV
# define HB_NO_GETENV
# endif
# if _WIN32_WCE < 0x800
# define setlocale(Category, Locale) "C"
static int errno = 0; /* Use something better? */
# endif
# elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
# define getenv(Name) nullptr
# ifndef HB_NO_GETENV
# define HB_NO_GETENV
# endif
# endif
# if defined(_MSC_VER) && _MSC_VER < 1900
# define snprintf _snprintf
# endif
#endif
#ifdef HB_NO_GETENV
#define getenv(Name) nullptr
#endif
#if defined(HAVE_ATEXIT) && !defined(HB_USE_ATEXIT)
/* atexit() is only safe to be called from shared libraries on certain
* platforms. Whitelist.