Sha256: 11a03e27b8cbc16fc2c34a214040282a7ba0ca3874ebd48ff58d22aeb58f0439

Contents?: true

Size: 1.54 KB

Versions: 93

Compression:

Stored size: 1.54 KB

Contents

#ifndef RUBY_ASSERT_H
#define RUBY_ASSERT_H

#include "ruby/ruby.h"

#if defined(__cplusplus)
extern "C" {
#if 0
} /* satisfy cc-mode */
#endif
#endif

NORETURN(void rb_assert_failure(const char *, int, const char *, const char *));
#ifdef RUBY_FUNCTION_NAME_STRING
# define RUBY_ASSERT_FAIL(expr) \
    rb_assert_failure(__FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING, expr)
#else
# define RUBY_ASSERT_FAIL(expr) \
    rb_assert_failure(__FILE__, __LINE__, NULL, expr)
#endif
#define RUBY_ASSERT_MESG(expr, mesg) \
    ((expr) ? (void)0 : RUBY_ASSERT_FAIL(mesg))
#ifdef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
# define RUBY_ASSERT_MESG_WHEN(cond, expr, mesg) \
    __builtin_choose_expr( \
	__builtin_constant_p(cond), \
	__builtin_choose_expr(cond, RUBY_ASSERT_MESG(expr, mesg), (void)0), \
	RUBY_ASSERT_MESG(!(cond) || (expr), mesg))
#else
# 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_WHEN(cond, expr) RUBY_ASSERT_MESG_WHEN(cond, expr, #expr)

#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
/* C89 compilers are required to support strings of only 509 chars. */
/* can't use RUBY_ASSERT for such compilers. */
#include <assert.h>
#else
#undef assert
#define assert RUBY_ASSERT
#endif

#ifndef RUBY_NDEBUG
# ifdef NDEBUG
#   define RUBY_NDEBUG 1
# else
#   define RUBY_NDEBUG 0
# endif
#endif

#if defined(__cplusplus)
#if 0
{ /* satisfy cc-mode */
#endif
}  /* extern "C" { */
#endif

#endif

Version data entries

93 entries across 34 versions & 3 rubygems

Version Path
debase-ruby_core_source-0.10.15 lib/debase/ruby_core_source/ruby-2.6.0-p0/ruby_assert.h
debase-ruby_core_source-0.10.15 lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h
debase-ruby_core_source-0.10.14 lib/debase/ruby_core_source/ruby-2.6.0-p0/ruby_assert.h
debase-ruby_core_source-0.10.14 lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/debase-ruby_core_source-0.10.13/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.12/lib/debase/ruby_core_source/ruby-2.6.0-p0/ruby_assert.h
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.12/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/debase-ruby_core_source-0.10.13/lib/debase/ruby_core_source/ruby-2.6.0-p0/ruby_assert.h
debase-ruby_core_source-0.10.13 lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h
debase-ruby_core_source-0.10.13 lib/debase/ruby_core_source/ruby-2.6.0-p0/ruby_assert.h
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/debase-ruby_core_source-0.10.12/lib/debase/ruby_core_source/ruby-2.6.0-p0/ruby_assert.h
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.12/lib/debase/ruby_core_source/ruby-2.6.0-p0/ruby_assert.h
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.12/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/debase-ruby_core_source-0.10.12/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.12/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/debase-ruby_core_source-0.10.11/lib/debase/ruby_core_source/ruby-2.6.0-p0/ruby_assert.h
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/debase-ruby_core_source-0.10.11/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/debase-ruby_core_source-0.10.12/lib/debase/ruby_core_source/ruby-2.6.0-p0/ruby_assert.h
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/debase-ruby_core_source-0.10.12/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/debase-ruby_core_source-0.10.11/lib/debase/ruby_core_source/ruby-2.6.0-p0/ruby_assert.h