repr
0.1
Reconstructable string representations and more
Toggle main menu visibility
Main Page
Installation
Usage
Customization
Extending
FAQ
CI Results
Test
Benchmark
API Documentation
Namespace List
Namespace List
Namespace Members
All
_
a
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
Functions
_
a
c
d
e
f
g
i
l
m
n
o
r
s
t
u
v
w
Variables
Typedefs
Enumerations
Concept List
Class List
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
_
a
c
e
f
g
i
l
m
n
o
p
r
s
t
v
w
~
Variables
a
b
c
d
e
f
g
i
k
l
m
n
o
p
q
r
s
t
u
v
Typedefs
a
c
d
e
f
g
h
l
m
p
r
s
t
u
v
w
Enumerations
Enumerator
Related Symbols
File List
File List
File Members
All
_
l
n
o
r
u
Variables
Macros
_
l
o
r
u
Examples
Source Code
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Concepts
Loading...
Searching...
No Matches
assert.h
Go to the documentation of this file.
#pragma once
#include <
librepr/feature.h
>
#include "
platform.h
"
#include "
default.h
"
#include "
format.h
"
#ifndef LIBREPR_DEBUG
# if USING(LIBREPR_COMPILER_MSVC)
# if defined(_DEBUG) && !defined(NDEBUG)
# define LIBREPR_DEBUG 1
# endif
# else
# if !defined(NDEBUG)
# define LIBREPR_DEBUG 1
# endif
# endif
#endif
// LIBREPR_DEBUG?
#if USING(LIBREPR_PLATFORM_WINDOWS)
# if USING(LIBREPR_COMPILER_MSVC)
// _CRT_*_C_HEADER macros
# include <vcruntime.h>
# define LIBREPR_CRT_BEGIN_C _CRT_BEGIN_C_HEADER
# define LIBREPR_CRT_END_C _CRT_END_C_HEADER
# else
# define LIBREPR_CRT_BEGIN_C \
_Pragma("pack(push, 8)") \
extern "C" {
# define LIBREPR_CRT_END_C } \
_Pragma("pack(pop)")
# endif
#endif
#include <
assert.h
>
// Underlying asserts
#if USING(LIBREPR_PLATFORM_WINDOWS)
# define LIBREPR_UND_ASSERT_(...) \
_assert((__VA_ARGS__), (__FILE__), unsigned(__LINE__))
/*
* Expose the normal string assertion function.
* Windows generally uses `_wassert` for their
* `assert`, which we don't want.
*/
LIBREPR_CRT_BEGIN_C
__declspec(dllimport)
void
__cdecl _assert(
// NOLINT
char
const
* _Message,
char
const
* _File,
unsigned
_Line
);
LIBREPR_CRT_END_C
#elif USING(LIBREPR_PLATFORM_MACOS)
# define LIBREPR_UND_ASSERT_(...) \
__assert_rtn((__func__), (__FILE__), unsigned(__LINE__), (__VA_ARGS__))
#else
# define LIBREPR_UND_ASSERT_(...) \
__assert_fail((__VA_ARGS__), __FILE__, __LINE__, __PRETTY_FUNCTION__)
# define LIBREPR_UND_ASSERT_(...) \
…
#endif
// Exposing assertion functions
#ifdef LIBREPR_DEBUG
# define LIBREPR_EXASSERT(...) \
LIBREPR_UND_ASSERT_((REPR_FORMAT(__VA_ARGS__)).c_str())
# define LIBREPR_EXASSERT(...) \
…
# define LIBREPR_ASSERT(cond, ...) \
do { if(!(cond)) [[unlikely]] { LIBREPR_EXASSERT(__VA_ARGS__); } } while(0)
# define LIBREPR_ASSERT(cond, ...) \
…
#else
# define LIBREPR_EXASSERT(...) ::librepr::detail::unreachable()
# define LIBREPR_ASSERT(...) (void)(0)
#endif
#if USING(REPR_HARD_CHECKS)
# define LIBREPR_SOFT_ASSERT(...) LIBREPR_ASSERT(__VA_ARGS__)
#else
# define LIBREPR_SOFT_ASSERT(...) (void)(0)
#endif
#ifdef __cpp_lib_unreachable
# define LIBREPR_UNREACHABLE() std::unreachable()
#elif USING(LIBREPR_COMPILER_MSVC)
# define LIBREPR_UNREACHABLE() __assume(false)
#else
# define LIBREPR_UNREACHABLE() __builtin_unreachable()
#endif
namespace
librepr::detail
{
#ifndef __cpp_lib_unreachable
[[
noreturn
]]
inline
void
unreachable
() {
LIBREPR_UNREACHABLE
();
}
[[
noreturn
]]
inline
void
unreachable
() {
…
}
#else
// Supports unreachable
using
std::unreachable;
#endif
// __cpp_lib_unreachable
}
// namespace librepr::detail
namespace
librepr::detail
{
…
}
include
librepr
macro
assert.h
Generated by
1.9.8, using the excellent
Doxygen Awesome
Theme