From e19db15104a2fcb0df4f59cea117a1025b3affe5 Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Tue, 9 Feb 2021 03:12:26 +0000 Subject: [PATCH] render: use portable HAS_INCLUDE() wrapper instead of __has_include() --- macros.h | 6 ++++++ render.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/macros.h b/macros.h index 206c18d3..52c24e0e 100644 --- a/macros.h +++ b/macros.h @@ -27,6 +27,12 @@ #define HAS_BUILTIN(x) 0 #endif +#ifdef __has_include + #define HAS_INCLUDE(x) __has_include(x) +#else + #define HAS_INCLUDE(x) 0 +#endif + #ifdef __has_feature #define HAS_FEATURE(x) __has_feature(x) #else diff --git a/render.c b/render.c index c64692b8..71d54f4c 100644 --- a/render.c +++ b/render.c @@ -9,7 +9,9 @@ #include #include #include -#if __has_include() + +#include "macros.h" +#if HAS_INCLUDE() #include #define pthread_setname_np(thread, name) (pthread_set_name_np(thread, name), 0) #elif defined(__NetBSD__)