aboutsummaryrefslogtreecommitdiffstats
path: root/ruby_assert.h
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2019-07-19 12:04:32 +0900
committerKoichi Sasada <ko1@atdot.net>2019-07-19 12:04:32 +0900
commit63160a84b42cd3a7924e5abe94bbb08bb566f24b (patch)
tree33f0373fffdd300634db238f0c31e855b395398f /ruby_assert.h
parente644e2de85d0d76e1c28d45710f765757a22f5c6 (diff)
downloadruby-63160a84b42cd3a7924e5abe94bbb08bb566f24b.tar.gz
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.
Diffstat (limited to 'ruby_assert.h')
-rw-r--r--ruby_assert.h5
1 files changed, 5 insertions, 0 deletions
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