From bef14ca512ea575aff6f661fdad794263938795d Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Fri, 22 Nov 2024 12:38:48 +0100 Subject: [PATCH] bindings/blst.h: harmonize with the new C23 standard. Fixes #240. --- bindings/blst.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bindings/blst.h b/bindings/blst.h index 8e0a488c..8d90abf0 100644 --- a/bindings/blst.h +++ b/bindings/blst.h @@ -23,15 +23,17 @@ typedef __UINT64_TYPE__ uint64_t; #ifdef __cplusplus extern "C" { -#elif defined(__BLST_CGO__) +#elif !defined(__STDC_VERSION__) || __STDC_VERSION__<202311 +# if defined(__BLST_CGO__) typedef _Bool bool; /* it's assumed that cgo calls modern enough compiler */ -#elif !defined(bool) -# if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901 -# define bool _Bool -# else -# define bool int +# elif !defined(bool) +# if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901 +# define bool _Bool +# else +# define bool int +# endif +# define __blst_h_bool__ # endif -# define __blst_h_bool__ #endif #ifdef SWIG