diff --git a/include/compat/sys/queue.h b/include/compat/sys/queue.h index 946c9be..a99db26 100644 --- a/include/compat/sys/queue.h +++ b/include/compat/sys/queue.h @@ -34,7 +34,6 @@ #ifndef _SYS_QUEUE_H_ #define _SYS_QUEUE_H_ -#include /* * This file defines four types of data structures: singly-linked lists, diff --git a/lib/libpe/error.c b/lib/libpe/error.c index 3caf1bb..46ea2f1 100644 --- a/lib/libpe/error.c +++ b/lib/libpe/error.c @@ -118,12 +118,9 @@ void pe_error_print(FILE *stream, pe_err_e error) { // Since we define _GNU_SOURCE in our Makefile, strerror_r should be GNU-compliant. // However, looks like if you're on macOS, strerror_r is XSI-compliant. -#if defined(__DARWIN_C_LEVEL) // XSI-compliant - /* int ret = */ strerror_r(errno, errmsg, sizeof errmsg); - const char *errmsg_ptr = errmsg; -#elif defined(_GNU_SOURCE) // GNU-specific +#if defined(__GLIBC__) && defined(_GNU_SOURCE) // we have GNU strerror_r const char *errmsg_ptr = strerror_r(errno, errmsg, sizeof errmsg); -#else // Fallback to XSI-compliant +#else // we don't have it /* int ret = */ strerror_r(errno, errmsg, sizeof errmsg); const char *errmsg_ptr = errmsg; #endif