Skip to content

Commit 0d27f64

Browse files
committed
patch 7.4.987
Problem: Can't build with Ruby 1.9.2. Solution: Require Rub 2.0 for defining USE_TYPEDDATA.
1 parent da9888a commit 0d27f64

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/if_ruby.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@
8181
# define RUBY19_OR_LATER 1
8282
#endif
8383

84+
#if (defined(RUBY_VERSION) && RUBY_VERSION >= 20) \
85+
|| (defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20)
86+
# define RUBY20_OR_LATER 1
87+
#endif
88+
8489
#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19
8590
/* Ruby 1.9 defines a number of static functions which use rb_num2long and
8691
* rb_int2big */
@@ -122,11 +127,12 @@
122127
#endif
123128

124129
/*
125-
* The TypedData_XXX macro family can be used since Ruby 1.9.2, and
126-
* the old Data_XXX macro family was deprecated on Ruby 2.2.
130+
* The TypedData_XXX macro family can be used since Ruby 1.9.2 but
131+
* rb_data_type_t changed in 1.9.3, therefore require at least 2.0.
132+
* The old Data_XXX macro family was deprecated on Ruby 2.2.
127133
* Use TypedData_XXX if available.
128134
*/
129-
#ifdef TypedData_Wrap_Struct
135+
#if defined(TypedData_Wrap_Struct) && defined(RUBY20_OR_LATER)
130136
# define USE_TYPEDDATA 1
131137
#endif
132138

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
987,
744746
/**/
745747
986,
746748
/**/

0 commit comments

Comments
 (0)