Ruby  2.5.0dev(2017-10-22revision60238)
Macros | Functions
ruby_assert.h File Reference
#include "ruby/ruby.h"

Go to the source code of this file.

Macros

#define RUBY_ASSERT_FAIL(expr)   rb_assert_failure(__FILE__, __LINE__, NULL, expr)
 
#define RUBY_ASSERT_MESG(expr, mesg)   ((expr) ? (void)0 : RUBY_ASSERT_FAIL(mesg))
 
#define RUBY_ASSERT_MESG_WHEN(cond, expr, mesg)   RUBY_ASSERT_MESG(!(cond) || (expr), mesg)
 
#define RUBY_ASSERT(expr)   RUBY_ASSERT_MESG_WHEN(!RUBY_NDEBUG+0, expr, #expr)
 
#define RUBY_ASSERT_WHEN(cond, expr)   RUBY_ASSERT_MESG_WHEN(cond, expr, #expr)
 
#define assert   RUBY_ASSERT
 
#define RUBY_NDEBUG   0
 

Functions

 NORETURN (void rb_assert_failure(const char *, int, const char *, const char *))
 

Macro Definition Documentation

◆ assert

#define assert   RUBY_ASSERT

◆ RUBY_ASSERT

#define RUBY_ASSERT (   expr)    RUBY_ASSERT_MESG_WHEN(!RUBY_NDEBUG+0, expr, #expr)

Definition at line 33 of file ruby_assert.h.

◆ RUBY_ASSERT_FAIL

#define RUBY_ASSERT_FAIL (   expr)    rb_assert_failure(__FILE__, __LINE__, NULL, expr)

Definition at line 18 of file ruby_assert.h.

◆ RUBY_ASSERT_MESG

#define RUBY_ASSERT_MESG (   expr,
  mesg 
)    ((expr) ? (void)0 : RUBY_ASSERT_FAIL(mesg))

Definition at line 21 of file ruby_assert.h.

◆ RUBY_ASSERT_MESG_WHEN

#define RUBY_ASSERT_MESG_WHEN (   cond,
  expr,
  mesg 
)    RUBY_ASSERT_MESG(!(cond) || (expr), mesg)

Definition at line 30 of file ruby_assert.h.

◆ RUBY_ASSERT_WHEN

#define RUBY_ASSERT_WHEN (   cond,
  expr 
)    RUBY_ASSERT_MESG_WHEN(cond, expr, #expr)

Definition at line 34 of file ruby_assert.h.

◆ RUBY_NDEBUG

#define RUBY_NDEBUG   0

Definition at line 43 of file ruby_assert.h.

Function Documentation

◆ NORETURN()

NORETURN ( void   rb_assert_failureconst char *, int, const char *, const char *)