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:
parent
29d012c964
commit
47a1f5ff73
2 changed files with 16 additions and 0 deletions
|
@ -14,6 +14,20 @@
|
||||||
#include "ruby/ruby.h"
|
#include "ruby/ruby.h"
|
||||||
#include <float.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
|
#ifndef RB_UNUSED_VAR
|
||||||
# ifdef __GNUC__
|
# ifdef __GNUC__
|
||||||
# define RB_UNUSED_VAR(x) x __attribute__ ((unused))
|
# define RB_UNUSED_VAR(x) x __attribute__ ((unused))
|
||||||
|
|
|
@ -28,6 +28,8 @@ end
|
||||||
|
|
||||||
check_bigdecimal_version(gemspec_path)
|
check_bigdecimal_version(gemspec_path)
|
||||||
|
|
||||||
|
have_header("stdbool.h")
|
||||||
|
|
||||||
have_func("labs", "stdlib.h")
|
have_func("labs", "stdlib.h")
|
||||||
have_func("llabs", "stdlib.h")
|
have_func("llabs", "stdlib.h")
|
||||||
have_func("finite", "math.h")
|
have_func("finite", "math.h")
|
||||||
|
|
Loading…
Reference in a new issue