From 68d8cc8ab4604bf9834fa20eef4d1557f20096f0 Mon Sep 17 00:00:00 2001 From: Tarak Ben Youssef Date: Wed, 21 Jan 2026 14:34:52 +0800 Subject: [PATCH 1/2] update bool def --- bls12381_utils.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bls12381_utils.h b/bls12381_utils.h index 89a3ee9a..eb51af92 100644 --- a/bls12381_utils.h +++ b/bls12381_utils.h @@ -28,7 +28,16 @@ #include typedef uint8_t byte; -typedef _Bool bool; // assuming cgo is using a modern enough compiler + +#if !defined(__STDC_VERSION__) || __STDC_VERSION__<202311 +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 +# endif +#endif // minimum targeted security level #define SEC_BITS 128 From 6432529468d1822fbfcaffffd716629c1e30212a Mon Sep 17 00:00:00 2001 From: Tarak Ben Youssef Date: Wed, 21 Jan 2026 21:21:05 +0800 Subject: [PATCH 2/2] fix C format --- bls12381_utils.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bls12381_utils.h b/bls12381_utils.h index eb51af92..eead12e7 100644 --- a/bls12381_utils.h +++ b/bls12381_utils.h @@ -29,14 +29,14 @@ typedef uint8_t byte; -#if !defined(__STDC_VERSION__) || __STDC_VERSION__<202311 +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311 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 -# endif +#elif !defined(bool) +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901 +#define bool _Bool +#else +#define bool int +#endif #endif // minimum targeted security level