Replaced 'glibc' checks with more general 'linux' checks in order to better support alternative C libraries (e.g. musl libc).

This commit is contained in:
LoRd_MuldeR 2021-11-12 20:40:51 +01:00
parent 153aca4517
commit 801f812714
Signed by: mulder
GPG Key ID: 2B5913365F57E03F
2 changed files with 4 additions and 12 deletions

View File

@ -57,7 +57,7 @@ ifneq ($(NALYZE),0)
CFLAGS += -fanalyzer
endif
MACHINE := $(shell $(CC) -dumpmachine)
MACHINE := $(shell $(CC) -dumpmachine || echo unknown)
ifeq ($(MACHINE),$(filter %mingw32 %-windows-gnu %-cygwin %-cygnus,$(MACHINE)))
SUFFIX := .exe

View File

@ -41,23 +41,15 @@ static INLINE size_t MIN_SIZE(const size_t a, const size_t b) { return (a > b) ?
/* detect getentropy() support */
#undef GETENTROPY
#if defined(__linux__) && defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25)
# define GETENTROPY getentropy
#elif defined(__FreeBSD__) && (__FreeBSD__ >= 12)
# define GETENTROPY getentropy
#elif defined(__OpenBSD__) && (__OpenBSD__ >= 1)
#if (defined(__linux__) && (__linux__ >= 1)) || (defined(__FreeBSD__) && (__FreeBSD__ >= 12)) || (defined(__OpenBSD__) && (__OpenBSD__ >= 1))
# define GETENTROPY getentropy
#endif
/* detect explicit_bzero() support */
#undef EXPLICIT_BZERO
#if defined(_WIN32) && defined(SecureZeroMemory)
#if defined(_WIN32) && (_WIN32 >= 1) && defined(SecureZeroMemory)
# define EXPLICIT_BZERO SecureZeroMemory
#elif defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25)
# define EXPLICIT_BZERO explicit_bzero
#elif defined(__FreeBSD__) && (__FreeBSD__ >= 11)
# define EXPLICIT_BZERO explicit_bzero
#elif defined(__OpenBSD__) && (__OpenBSD__ >= 1)
#elif (defined(__linux__) && (__linux__ >= 1)) || (defined(__FreeBSD__) && (__FreeBSD__ >= 11)) || (defined(__OpenBSD__) && (__OpenBSD__ >= 1))
# define EXPLICIT_BZERO explicit_bzero
#endif