From 963497c778c4c1a972c1368bb2b9687f60032dac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Thu, 6 Sep 2018 13:45:42 +0200 Subject: [PATCH 1/2] win32: replace the check for _MSC_VER by a more generic __has_include check The check has the same effect since support for stdbool.h and __has_include were both introduced in the same MSVC version, but at least now it also works with MinGW --- src/whereami.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/whereami.c b/src/whereami.c index a8a649d..68b3b18 100644 --- a/src/whereami.c +++ b/src/whereami.c @@ -68,8 +68,10 @@ extern "C" { #if defined(_MSC_VER) #pragma warning(pop) #endif -#if (_MSC_VER >= 1900) -#include +#if defined __has_include +# if __has_include () +# include +# endif #else #define bool int #define false 0 From 03ce77f4f0228783c1424aca0e62af3878971162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Tue, 31 Dec 2024 09:40:59 -0500 Subject: [PATCH 2/2] win32: update bool detection with pr comments --- src/whereami.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/whereami.c b/src/whereami.c index 68b3b18..ffc58de 100644 --- a/src/whereami.c +++ b/src/whereami.c @@ -68,10 +68,13 @@ extern "C" { #if defined(_MSC_VER) #pragma warning(pop) #endif -#if defined __has_include -# if __has_include () -# include -# endif + +#if (_MSC_VER >= 1900) +#include +#elif defined(__has_include) +#if __has_include() +#include +#endif #else #define bool int #define false 0