mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-09 09:48:25 +02:00
[cairoint.h] Add COMPILE_TIME_ASSERT()
This commit is contained in:
parent
043ed895ad
commit
2e4d6acd09
1 changed files with 4 additions and 0 deletions
|
|
@ -127,6 +127,10 @@ do { \
|
|||
static const int NOT_REACHED = 0; \
|
||||
assert (NOT_REACHED); \
|
||||
} while (0)
|
||||
#define COMPILE_TIME_ASSERT1(condition, line) \
|
||||
typedef int compile_time_assertion_at_line_##line##_failed [(condition)?1:-1];
|
||||
#define COMPILE_TIME_ASSERT0(condition, line) COMPILE_TIME_ASSERT1(condition, line)
|
||||
#define COMPILE_TIME_ASSERT(condition) COMPILE_TIME_ASSERT0(condition, __LINE__)
|
||||
|
||||
#define CAIRO_ALPHA_IS_OPAQUE(alpha) ((alpha) >= ((double)0xff00 / (double)0xffff))
|
||||
#define CAIRO_ALPHA_SHORT_IS_OPAQUE(alpha) ((alpha) >= 0xff00)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue