Go to the source code of this file.
Classes | |
struct | static_assertion< true > |
Defines | |
#define | CLASP_ASSERT_CONTRACT(exp) CLASP_ASSERT_CONTRACT_MSG(exp, #exp) |
#define | CLASP_ASSERT_CONTRACT_MSG(exp, msg) (void)( (!!(exp)) || (throw std::logic_error(clasp_format_error("%s@%d: contract violated: %s", FUNC_NAME, __LINE__, (msg))), 0)) |
#define | CLASP_FAIL_IF(exp, fmt,...) (void)( (!(exp)) || (throw std::logic_error(clasp_format_error(fmt, ##__VA_ARGS__ )), 0)) |
#define | CLASP_PRAGMA_TODO(X) |
#define | clear_bit(x, n) ( (x) & ~BIT_MASK((x),(n)) ) |
#define | FUNC_NAME __FILE__ |
#define | INT16_MAX (0x7fff) |
#define | INT16_MIN (-INT16_MAX - 1) |
#define | INT64_MAX ((int64)(UINT64_MAX >> 1)) |
#define | right_most_bit(x) ( (x) & (-(x)) ) |
#define | set_bit(x, n) ( (x) | BIT_MASK((x),(n)) ) |
#define | static_assert(x, message) (void)sizeof(static_assertion< (x) >) |
#define | store_clear_bit(x, n) ( (x) &= ~BIT_MASK((x),(n)) ) |
#define | store_set_bit(x, n) ( (x) |= BIT_MASK((x),(n)) ) |
#define | store_toggle_bit(x, n) ( (x) ^= BIT_MASK((x),(n)) ) |
#define | STRING(x) STRING2(x) |
#define | STRING2(x) #x |
#define | test_bit(x, n) ( ((x) & BIT_MASK((x),(n))) != 0 ) |
#define | toggle_bit(x, n) ( (x) ^ BIT_MASK((x),(n)) ) |
#define | UINT32_MAX (~uint32(0)) |
#define | UINT64_MAX (~uint64(0)) |
#define | UINTP_MAX (~uintp(0)) |
Functions | |
template<class T > | |
bool | aligned (void *mem) |
const char * | clasp_format (char *buf, unsigned size, const char *m,...) |
const char * | clasp_format_error (const char *m,...) |
#define CLASP_ASSERT_CONTRACT | ( | exp | ) | CLASP_ASSERT_CONTRACT_MSG(exp, #exp) |
Definition at line 146 of file platform.h.
#define CLASP_ASSERT_CONTRACT_MSG | ( | exp, | |
msg | |||
) | (void)( (!!(exp)) || (throw std::logic_error(clasp_format_error("%s@%d: contract violated: %s", FUNC_NAME, __LINE__, (msg))), 0)) |
Definition at line 138 of file platform.h.
#define CLASP_FAIL_IF | ( | exp, | |
fmt, | |||
... | |||
) | (void)( (!(exp)) || (throw std::logic_error(clasp_format_error(fmt, ##__VA_ARGS__ )), 0)) |
Definition at line 133 of file platform.h.
#define CLASP_PRAGMA_TODO | ( | X | ) |
Definition at line 150 of file platform.h.
#define clear_bit | ( | x, | |
n | |||
) | ( (x) & ~BIT_MASK((x),(n)) ) |
Definition at line 97 of file platform.h.
#define FUNC_NAME __FILE__ |
Definition at line 92 of file platform.h.
#define INT16_MAX (0x7fff) |
Definition at line 86 of file platform.h.
Definition at line 89 of file platform.h.
#define INT64_MAX ((int64)(UINT64_MAX >> 1)) |
Definition at line 80 of file platform.h.
#define right_most_bit | ( | x | ) | ( (x) & (-(x)) ) |
Definition at line 108 of file platform.h.
#define set_bit | ( | x, | |
n | |||
) | ( (x) | BIT_MASK((x),(n)) ) |
Definition at line 96 of file platform.h.
#define static_assert | ( | x, | |
message | |||
) | (void)sizeof(static_assertion< (x) >) |
Definition at line 127 of file platform.h.
#define store_clear_bit | ( | x, | |
n | |||
) | ( (x) &= ~BIT_MASK((x),(n)) ) |
Definition at line 102 of file platform.h.
#define store_set_bit | ( | x, | |
n | |||
) | ( (x) |= BIT_MASK((x),(n)) ) |
Definition at line 101 of file platform.h.
#define store_toggle_bit | ( | x, | |
n | |||
) | ( (x) ^= BIT_MASK((x),(n)) ) |
Definition at line 103 of file platform.h.
Definition at line 28 of file platform.h.
#define STRING2 | ( | x | ) | #x |
Definition at line 27 of file platform.h.
#define test_bit | ( | x, | |
n | |||
) | ( ((x) & BIT_MASK((x),(n))) != 0 ) |
Definition at line 106 of file platform.h.
#define toggle_bit | ( | x, | |
n | |||
) | ( (x) ^ BIT_MASK((x),(n)) ) |
Definition at line 98 of file platform.h.
#define UINT32_MAX (~uint32(0)) |
Definition at line 74 of file platform.h.
#define UINT64_MAX (~uint64(0)) |
Definition at line 77 of file platform.h.
#define UINTP_MAX (~uintp(0)) |
Definition at line 83 of file platform.h.
bool aligned | ( | void * | mem | ) |
Definition at line 111 of file platform.h.
const char* clasp_format | ( | char * | buf, |
unsigned | size, | ||
const char * | m, | ||
... | |||
) |
Definition at line 34 of file parser.cpp.
const char* clasp_format_error | ( | const char * | m, |
... | |||
) |
Definition at line 42 of file parser.cpp.