Skip to content

Commit 124daf7

Browse files
Fix Windows extension feature detection
1 parent 142da3f commit 124daf7

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
os:
1717
- ubuntu
1818
- macos
19+
- windows
1920

2021
ruby:
2122
- "3.3"

ext/extconf.rb

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,24 @@
2727
$LDFLAGS << " -fsanitize=address -fsanitize=undefined"
2828
end
2929

30-
have_func("rb_tracearg_instruction_sequence", "ruby/debug.h")
30+
checking_for("rb_tracearg_instruction_sequence declaration") do
31+
if try_link(<<~C, "", werror: true)
32+
#include <ruby.h>
33+
#include <ruby/debug.h>
34+
35+
static VALUE (*rb_tracearg_instruction_sequence_pointer)(rb_trace_arg_t *) = rb_tracearg_instruction_sequence;
36+
37+
int main(void)
38+
{
39+
return rb_tracearg_instruction_sequence_pointer == 0;
40+
}
41+
C
42+
$defs << "-DHAVE_RB_TRACEARG_INSTRUCTION_SEQUENCE"
43+
true
44+
else
45+
false
46+
end
47+
end
3148

3249
create_header
3350

0 commit comments

Comments
 (0)