Skip to content

Commit e9decbe

Browse files
committed
Resolve unused method warnings for GC compaction methods on older Ruby versions
1 parent 1bf5a3b commit e9decbe

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

ext/mysql2/result.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ static size_t rb_mysql_result_memsize(const void * wrapper) {
143143
return memsize;
144144
}
145145

146+
#ifdef HAVE_RB_GC_MARK_MOVABLE
146147
static void rb_mysql_result_compact(void * wrapper) {
147148
mysql2_result_wrapper * w = wrapper;
148149
if (w) {
@@ -153,6 +154,7 @@ static void rb_mysql_result_compact(void * wrapper) {
153154
rb_mysql2_gc_location(w->statement);
154155
}
155156
}
157+
#endif
156158

157159
static const rb_data_type_t rb_mysql_result_type = {
158160
"rb_mysql_result",

ext/mysql2/statement.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ static size_t rb_mysql_stmt_memsize(const void * ptr) {
3333
return sizeof(*stmt_wrapper);
3434
}
3535

36+
#ifdef HAVE_RB_GC_MARK_MOVABLE
3637
static void rb_mysql_stmt_compact(void * ptr) {
3738
mysql_stmt_wrapper *stmt_wrapper = ptr;
3839
if (!stmt_wrapper) return;
3940

4041
rb_mysql2_gc_location(stmt_wrapper->client);
4142
}
43+
#endif
4244

4345
static const rb_data_type_t rb_mysql_statement_type = {
4446
"rb_mysql_statement",

0 commit comments

Comments
 (0)