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:
parent
153aca4517
commit
801f812714
2
Makefile
2
Makefile
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user