зеркало из https://github.com/github/ruby.git
vm_core.h: make VM_ASSERT an expression
* vm_core.h (VM_ASSERT): make an expression, as well as standard assert(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
a3b89d7493
Коммит
f0fd305528
|
@ -21,11 +21,11 @@
|
|||
#endif
|
||||
|
||||
#if VM_CHECK_MODE > 0
|
||||
#define VM_ASSERT(expr) do { \
|
||||
if(!(expr)) rb_bug("%s:%d assertion violation - %s", __FILE__, __LINE__, #expr); \
|
||||
} while (0)
|
||||
#define VM_ASSERT(expr) ( \
|
||||
LIKELY(expr) ? (void)0 : \
|
||||
rb_bug("%s:%d assertion violation - %s", __FILE__, __LINE__, #expr))
|
||||
#else
|
||||
#define VM_ASSERT(expr)
|
||||
#define VM_ASSERT(expr) ((void)0)
|
||||
#endif
|
||||
|
||||
#define RUBY_VM_THREAD_MODEL 2
|
||||
|
|
Загрузка…
Ссылка в новой задаче