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
macro/util.h
Go to the documentation of this file.
#pragma once
#include <
librepr/feature.h
>
#include "
platform.h
"
#ifndef __has_attribute
# define __has_attribute(x) (0)
#endif
#ifndef __has_builtin
#define LIBREPR_HAS_BUILTIN(BUILTIN) (0)
#else
#define LIBREPR_HAS_BUILTIN(BUILTIN) __has_builtin(BUILTIN)
#endif
#ifndef __has_builtin
# define __has_builtin(x) (0)
#endif
#ifndef __has_include
# define __has_include(x) (0)
#endif
#ifndef __has_warning
// GCC/Clang specific
#define __has_warning(x) (0)
#endif
#ifdef __has_cpp_attribute
# define REPR_HAS_CPP_ATTR(x) __has_cpp_attribute(x)
#else
# define REPR_HAS_CPP_ATTR(x) (0)
#endif
// Inlining macros
#if USING(LIBREPR_COMPILER_GCC) || USING(LIBREPR_COMPILER_CLANG)
# define LIBREPR_PROPAGATE_INLINE __attribute__(( \
always_inline, flatten, artificial)) inline
# define LIBREPR_FORCE_INLINE __attribute__(( \
always_inline, artificial)) inline
# define LIBREPR_NOINLINE __attribute__((noinline))
#elif USING(LIBREPR_COMPILER_MSVC)
# define LIBREPR_FORCE_INLINE __forceinline
# define LIBREPR_HINT_INLINE __forceinline
# define LIBREPR_NOINLINE __declspec(noinline)
#endif
#ifndef LIBREPR_PROPAGATE_INLINE
# define LIBREPR_PROPAGATE_INLINE LIBREPR_FORCE_INLINE
#endif
#ifndef LIBREPR_FORCE_INLINE
# define LIBREPR_FORCE_INLINE inline
#endif
#ifndef LIBREPR_HINT_INLINE
# define LIBREPR_HINT_INLINE inline
#endif
#ifndef LIBREPR_NOINLINE
# define LIBREPR_NOINLINE
#endif
#if __has_attribute(nodebug)
# define LIBREPR_NODEBUG __attribute__((nodebug))
#else
# define LIBREPR_NODEBUG
#endif
#if REPR_HAS_CPP_ATTR(gnu::hot) \
&& REPR_HAS_CPP_ATTR(gnu::cold)
# define LIBREPR_HOT [[gnu::hot]]
# define LIBREPR_COLD [[gnu::cold]]
#elif defined(__GNUC__)
# define LIBREPR_HOT __attribute__((hot))
# define LIBREPR_COLD __attribute__((cold))
#else
# define LIBREPR_HOT
# define LIBREPR_COLD
#endif
#if USING(LIBREPR_COMPILER_MSVC)
# define LIBREPR_EMPTY_BASES __declspec(empty_bases)
#else
# define LIBREPR_EMPTY_BASES
#endif
#if USING(LIBREPR_COMPILER_CLANG) || USING(LIBREPR_COMPILER_MSVC)
# define LIBREPR_RESTRICT __restrict
#elif USING(LIBREPR_COMPILER_GCC)
# define LIBREPR_RESTRICT __restrict__
#else
# define LIBREPR_RESTRICT
#endif
#define LIBREPR_PRAGMA(...) _Pragma(#__VA_ARGS__)
// clang-format 18 introduces AllowShortCompoundRequirementOnASingleLine which
// should fix the formatting issue with this macro. Disable clang-format for now
// clang-format off
#define LIBREPR_MAYBE_DO(...) \
if constexpr (requires { { __VA_ARGS__ }; }) { \
__VA_ARGS__; \
}
#define LIBREPR_MAYBE_DO(...) \
…
// clang-format on
include
librepr
macro
util.h
Generated by
1.9.8, using the excellent
Doxygen Awesome
Theme