Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Macros | Functions
assert.h File Reference

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(!((RUBY_DEBUG+0) || (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 | RUBY_ASSERT_ALWAYS(expr) RUBY_ASSERT_MESG_WHEN(TRUE, expr, #expr)
#define | RUBY_DEBUG 0
#define | RUBY_NDEBUG 0

## Functions
| NORETURN (void rb_assert_failure(const char *, int, const char *, const char *))

## Macro Definition Documentation

## ◆ RUBY_ASSERT

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

Definition at line 32 of file assert.h.

## ◆ RUBY_ASSERT_ALWAYS

#define RUBY_ASSERT_ALWAYS | ( |  | expr | ) | RUBY_ASSERT_MESG_WHEN(TRUE, expr, #expr)

Definition at line 34 of file assert.h.

## ◆ RUBY_ASSERT_FAIL

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

Definition at line 16 of file assert.h.

## ◆ RUBY_ASSERT_MESG

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

Definition at line 19 of file assert.h.

## ◆ RUBY_ASSERT_MESG_WHEN

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

Definition at line 29 of file assert.h.

## ◆ RUBY_ASSERT_WHEN

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

Definition at line 33 of file assert.h.

## ◆ RUBY_DEBUG

#define RUBY_DEBUG 0

Definition at line 37 of file assert.h.

## ◆ RUBY_NDEBUG

#define RUBY_NDEBUG 0

Definition at line 43 of file assert.h.

## Function Documentation

## ◆ NORETURN()

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