[前][次][番号順一覧][スレッド一覧]

ruby-changes:56473

From: Nobuyoshi <ko1@a...>
Date: Sun, 14 Jul 2019 17:58:32 +0900 (JST)
Subject: [ruby-changes:56473] Nobuyoshi Nakada: 08c2a9dc59 (master): Introduce RUBY_DEBUG flag macro

https://git.ruby-lang.org/ruby.git/commit/?id=08c2a9dc59

From 08c2a9dc599021668e11dee2f099a204122eab90 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 14 Jul 2019 14:44:59 +0900
Subject: Introduce RUBY_DEBUG flag macro

When RUBY_DEBUG is turned on, all RUBY_ASSERT() macros will be
enabled regardless RUBY_NDEBUG.

diff --git a/include/ruby/assert.h b/include/ruby/assert.h
index aef36b8..f8930a7 100644
--- a/include/ruby/assert.h
+++ b/include/ruby/assert.h
@@ -28,9 +28,12 @@ NORETURN(void rb_assert_failure(const char *, int, const char *, const char *)); https://github.com/ruby/ruby/blob/trunk/include/ruby/assert.h#L28
 # define RUBY_ASSERT_MESG_WHEN(cond, expr, mesg) \
     RUBY_ASSERT_MESG(!(cond) || (expr), mesg)
 #endif
-#define RUBY_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(!RUBY_NDEBUG+0, expr, #expr)
+#define RUBY_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(RUBY_DEBUG+(!RUBY_NDEBUG+0), expr, #expr)
 #define RUBY_ASSERT_WHEN(cond, expr) RUBY_ASSERT_MESG_WHEN(cond, expr, #expr)
 
+#ifndef RUBY_DEBUG
+# define RUBY_DEBUG 0
+#endif
 #ifndef RUBY_NDEBUG
 # ifdef NDEBUG
 #   define RUBY_NDEBUG 1
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]