From e6cb1bc2bf4649c0a80aed0761ec76c439789f53 Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Thu, 25 Feb 2016 13:50:38 -0800 Subject: [PATCH] Compilers, basically an annoying coworkers. Fixes #815 --- ext/puma_http11/io_buffer.c | 2 +- ext/puma_http11/mini_ssl.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/puma_http11/io_buffer.c b/ext/puma_http11/io_buffer.c index 0fb97bc5..b12a1732 100644 --- a/ext/puma_http11/io_buffer.c +++ b/ext/puma_http11/io_buffer.c @@ -116,7 +116,7 @@ static VALUE buf_to_str(VALUE self) { struct buf_int* b; Data_Get_Struct(self, struct buf_int, b); - return rb_str_new(b->top, b->cur - b->top); + return rb_str_new((const char*)(b->top), b->cur - b->top); } static VALUE buf_used(VALUE self) { diff --git a/ext/puma_http11/mini_ssl.c b/ext/puma_http11/mini_ssl.c index 8b562164..e11f1fb9 100644 --- a/ext/puma_http11/mini_ssl.c +++ b/ext/puma_http11/mini_ssl.c @@ -1,7 +1,13 @@ #define RSTRING_NOT_MODIFIED 1 #include +#include + +#if RUBY_API_VERSION_MAJOR == 1 #include +#else +#include +#endif #ifdef HAVE_OPENSSL_BIO_H @@ -347,7 +353,7 @@ VALUE engine_peercert(VALUE self) { } } - rb_cert_buf = rb_str_new(buf, bytes); + rb_cert_buf = rb_str_new((const char*)(buf), bytes); if(!cert_buf) { OPENSSL_free(buf); }