2019-03-15 21:01:26 +01:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
|
|
|
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
|
|
|
|
//
|
|
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice is present in all copies. The
|
|
|
|
// full license for this software is available in the LICENSE file.
|
|
|
|
|
|
|
|
// This header allows for the use of soft-assertions. It is included before
|
|
|
|
// the standard <assert.h> and these declarations will take precedence.
|
|
|
|
//
|
|
|
|
// These declarations exist because the system declarations may have
|
|
|
|
// __attribute__((noreturn)) and our only modification here is to remove
|
|
|
|
// that. Alternative definitions to the standard library also exist in
|
|
|
|
// ircd/assert.cc
|
|
|
|
|
2019-05-29 00:53:25 +02:00
|
|
|
#pragma once
|
|
|
|
#define HAVE_IRCD_ASSERT_H
|
|
|
|
|
|
|
|
namespace ircd
|
|
|
|
{
|
|
|
|
void debugtrap();
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(RB_ASSERT) && defined(_ASSERT_H_DECLS)
|
|
|
|
#error "Do not include <assert.h> or <cassert> first."
|
|
|
|
#endif
|
|
|
|
|
2019-03-15 21:01:26 +01:00
|
|
|
#if defined(RB_ASSERT) && !defined(NDEBUG)
|
|
|
|
#define _ASSERT_H_DECLS
|
|
|
|
|
|
|
|
extern "C" void
|
2019-05-15 00:11:29 +02:00
|
|
|
__attribute__((visibility("default")))
|
2019-03-15 21:01:26 +01:00
|
|
|
__assert_fail(const char *__assertion,
|
|
|
|
const char *__file,
|
|
|
|
unsigned int __line,
|
|
|
|
const char *__function);
|
|
|
|
|
|
|
|
extern "C" void
|
2019-05-15 00:11:29 +02:00
|
|
|
__attribute__((visibility("default")))
|
2019-03-15 21:01:26 +01:00
|
|
|
__assert_perror_fail(int __errnum,
|
|
|
|
const char *__file,
|
|
|
|
unsigned int __line,
|
|
|
|
const char *__function);
|
|
|
|
|
|
|
|
extern "C" void
|
2019-05-15 00:11:29 +02:00
|
|
|
__attribute__((visibility("default")))
|
2019-03-15 21:01:26 +01:00
|
|
|
__assert(const char *__assertion,
|
|
|
|
const char *__file,
|
|
|
|
int __line);
|
|
|
|
|
|
|
|
#endif
|