From b946479b0f283789d9b6bc14d661b415e5184932 Mon Sep 17 00:00:00 2001 From: Watson Date: Wed, 21 Aug 2024 15:05:11 +0900 Subject: [PATCH] Fix build error with Ruby 3.1 on Windows Since Ruby 3.2, `pipe` function declaration is provided in https://github.com/ruby/ruby/blob/21c708ee802e1a59901eccc6448e40e8f72189b8/include/ruby/missing.h#L292 However, it does not provided it with Ruby 3.1. This patch will define `pipe` macro to use proper function due to fix build error. --- ext/io/event/interrupt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/io/event/interrupt.c b/ext/io/event/interrupt.c index 0907e8c1..da6f8cdd 100644 --- a/ext/io/event/interrupt.c +++ b/ext/io/event/interrupt.c @@ -25,6 +25,13 @@ #include "selector/selector.h" +#ifdef HAVE_RUBY_WIN32_H +#include +#if !defined(HAVE_PIPE) && !defined(pipe) +#define pipe(p) rb_w32_pipe(p) +#endif +#endif + #ifdef HAVE_SYS_EVENTFD_H #include