1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/bigdecimal] Define bool, true, and false for old Ruby

https://github.com/ruby/bigdecimal/commit/a6d3bd2d44
This commit is contained in:
Kenta Murata 2020-12-29 17:14:36 +09:00
parent 29d012c964
commit 47a1f5ff73
No known key found for this signature in database
GPG key ID: CEFE8AFB6081B062
2 changed files with 16 additions and 0 deletions

View file

@ -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))

View file

@ -28,6 +28,8 @@ end
check_bigdecimal_version(gemspec_path)
have_header("stdbool.h")
have_func("labs", "stdlib.h")
have_func("llabs", "stdlib.h")
have_func("finite", "math.h")