From 6c434e26ad6d692ecea32bbe41f539a3cbc71adf Mon Sep 17 00:00:00 2001 From: Watson Date: Fri, 4 Oct 2024 08:44:27 +0900 Subject: [PATCH] Fix build error with Ruby 3.1 on Windows (#112) 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