Skip to content

Commit 63160a8

Browse files
committed
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.
1 parent e644e2d commit 63160a8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ruby_assert.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@
88
#undef assert
99
#define assert RUBY_ASSERT
1010
#endif
11+
12+
#ifdef NDEBUG
13+
#undef RUBY_NDEBUG
14+
#define RUBY_NDEBUG 1
15+
#endif

0 commit comments

Comments
 (0)