From 63160a84b42cd3a7924e5abe94bbb08bb566f24b Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Fri, 19 Jul 2019 12:04:32 +0900 Subject: [PATCH] respect NDEBUG. ruby/ruby.h includes ruby/assert.h, and RUBY_NDEBUG is defined by checking NDEBUG. In other words, NDEBUG is only seen just after ruby/ruby.h. This patch also cheks NDEBUG just after including ruby_assert.h. Without this patch, assertions in array.c are always enabled. --- ruby_assert.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ruby_assert.h b/ruby_assert.h index 139256fed8..fa15da1e25 100644 --- a/ruby_assert.h +++ b/ruby_assert.h @@ -8,3 +8,8 @@ #undef assert #define assert RUBY_ASSERT #endif + +#ifdef NDEBUG + #undef RUBY_NDEBUG + #define RUBY_NDEBUG 1 +#endif