diff options
author | Kenta Murata <[email protected]> | 2020-12-29 17:14:36 +0900 |
---|---|---|
committer | Kenta Murata <[email protected]> | 2020-12-29 17:46:37 +0900 |
commit | 47a1f5ff738c5f14f4ffd7def3536b61ce1f9ff0 (patch) | |
tree | b36eaf73b81fea138ba92aa362807715cd64ee42 /ext/bigdecimal/bigdecimal.h | |
parent | 29d012c9641fa53464a03cc682b6a0f5bf7888df (diff) |
[ruby/bigdecimal] Define bool, true, and false for old Ruby
https://github.com/ruby/bigdecimal/commit/a6d3bd2d44
Diffstat (limited to 'ext/bigdecimal/bigdecimal.h')
-rw-r--r-- | ext/bigdecimal/bigdecimal.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/bigdecimal/bigdecimal.h b/ext/bigdecimal/bigdecimal.h index 28f3363b3c..c89f212ad3 100644 --- a/ext/bigdecimal/bigdecimal.h +++ b/ext/bigdecimal/bigdecimal.h @@ -14,6 +14,20 @@ #include "ruby/ruby.h" #include <float.h> +#if defined(__bool_true_false_are_defined) +# /* Take that. */ + +#elif defined(HAVE_STDBOOL_H) +# include <stdbool.h> + +#else +typedef unsigned char _Bool; +# define bool _Bool +# define true ((_Bool)+1) +# define false ((_Bool)-1) +# define __bool_true_false_are_defined +#endif + #ifndef RB_UNUSED_VAR # ifdef __GNUC__ # define RB_UNUSED_VAR(x) x __attribute__ ((unused)) |