From 649a0d3e3578cb385e1a20579c16aca306650b30 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 8 Jan 2023 18:36:56 +0000 Subject: httpd: undefine ruby_snprintf alias for non-Ruby processes ruby/subst.h (included by ruby.h) replaces `snprintf' with `ruby_snprintf'. This only works in processes linked to Ruby, but won't work in subprocesses spawned by Ruby. --- ext/mwrap/httpd.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/mwrap/httpd.h b/ext/mwrap/httpd.h index 03aef9f..da7ff6d 100644 --- a/ext/mwrap/httpd.h +++ b/ext/mwrap/httpd.h @@ -43,6 +43,14 @@ #define TYPE_CSV "text/csv" #define TYPE_PLAIN "text/plain" +/* + * C ruby defines snprintf to ruby_snprintf, we can't have that in + * non-ruby processes spawned by C ruby + */ +#if MWRAP_RUBY && defined(snprintf) +# undef snprintf +#endif + enum mw_qev { MW_QEV_IGNORE = 0, MW_QEV_RD = POLLIN, -- cgit v1.2.3-24-ge0c7