mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	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:
		
							parent
							
								
									a3b89d7493
								
							
						
					
					
						commit
						f0fd305528
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue