Skip to content

Commit

Permalink
bindings/blst.h: avoid macro conflict with <stdbool.h>.
Browse files Browse the repository at this point in the history
Fixes #189.
  • Loading branch information
dot-asm committed Sep 4, 2023
1 parent ed9dc1f commit 9c87d4a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bindings/blst.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ typedef __UINT64_TYPE__ uint64_t;
extern "C" {
#elif defined(__BLST_CGO__)
typedef _Bool bool; /* it's assumed that cgo calls modern enough compiler */
#elif 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

#ifdef SWIG
Expand Down Expand Up @@ -478,5 +481,8 @@ extern const blst_p2_affine BLS12_381_NEG_G2;

#ifdef __cplusplus
}
#elif defined(__blst_h_bool__)
# undef __blst_h_bool__
# undef bool
#endif
#endif

0 comments on commit 9c87d4a

Please sign in to comment.