1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

ruby: fix compilation with Ruby < 2.3

This commit is contained in:
Sébastien Helleu
2019-08-20 07:57:01 +02:00
parent 7f62985f89
commit 21dca71ee0
+6
View File
@@ -21,10 +21,16 @@
#ifndef WEECHAT_PLUGIN_RUBY_API_H
#define WEECHAT_PLUGIN_RUBY_API_H
/* required for Ruby < 2.3 */
#ifndef RB_FIXNUM_P
#define RB_FIXNUM_P(f) (((int)(SIGNED_VALUE)(f))&RUBY_FIXNUM_FLAG)
#endif
/* required for Ruby < 2.4 */
#ifndef RB_INTEGER_TYPE_P
#define RB_INTEGER_TYPE_P(obj) (RB_FIXNUM_P(obj) || RB_TYPE_P(obj, T_BIGNUM))
#endif
#define CHECK_INTEGER(obj) \
if (!RB_INTEGER_TYPE_P(obj)) \
{ \