From 606ce807a8291e6d76f93897bfa9f2ef1b7b7ea5 Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Thu, 22 Oct 2026 09:37:58 +0900 Subject: [PATCH] Refactor the Windows native spec fixture to use ev_wrap.h The fixture defined its own copy of the libev configuration, so settings added to ev_wrap.h, such as the evpipe handling from #128, did not reach the libev that it tests. Include libev.c, which builds libev for the extension, instead. Drop ext/libev from the include path as well, so that ev_wrap.h cannot resolve to the generated header of the same name in ext/libev. Co-Authored-By: Claude Opus 5.5 --- spec/fixtures/windows_stat_native.c | 6 +----- spec/windows_stat_native_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/spec/fixtures/windows_stat_native.c b/spec/fixtures/windows_stat_native.c index a1352a3..83144bb 100644 --- a/spec/fixtures/windows_stat_native.c +++ b/spec/fixtures/windows_stat_native.c @@ -91,11 +91,7 @@ test_socket (int af, int type, int protocol) #define CreateFileW test_create_file #define GetFileInformationByHandle test_file_information #define FindFirstFileExW test_find_file -#define EV_STANDALONE 1 -#define EV_USE_REALTIME 0 -#define EV_USE_MONOTONIC 0 -#define EV_WIN32_STAT_CODEPAGE CP_UTF8 -#include "ev.c" +#include "libev.c" #undef socket #undef GetQueuedCompletionStatus #undef CreateFileW diff --git a/spec/windows_stat_native_spec.rb b/spec/windows_stat_native_spec.rb index da76428..e320f4d 100644 --- a/spec/windows_stat_native_spec.rb +++ b/spec/windows_stat_native_spec.rb @@ -7,7 +7,7 @@ before(:context) do @build = Dir.mktmpdir('coolio-stat-native-') source = File.expand_path('fixtures/windows_stat_native.c', __dir__) - libev = File.expand_path('../ext/libev', __dir__) + coolio = File.expand_path('../ext/cool.io', __dir__) FileUtils.cp(source, @build) File.write(File.join(@build, 'extconf.rb'), <<~RUBY) begin @@ -16,7 +16,7 @@ # Other Windows toolchains can provide the compiler through PATH. end require 'mkmf' - $INCFLAGS << ' -I"#{libev}"' + $INCFLAGS << ' -I"#{coolio}"' abort 'ws2_32 is required' unless have_library('ws2_32') create_makefile('coolio_stat_native') RUBY