ReactOS 0.4.16-dev-1948-gd260c1d
helpers.h
Go to the documentation of this file.
1#pragma once
2
3#if __REACTOS__
4#define UACPI_STATIC_ASSERT _STATIC_ASSERT
5#else
6#ifdef __cplusplus
7#define UACPI_STATIC_ASSERT static_assert
8#else
9#define UACPI_STATIC_ASSERT _Static_assert
10#endif
11#endif
12
13#ifdef __REACTOS__
14#define UACPI_BUILD_BUG_ON_WITH_MSG(expr, msg) UACPI_STATIC_ASSERT(!(expr))
15#else
16#define UACPI_BUILD_BUG_ON_WITH_MSG(expr, msg) UACPI_STATIC_ASSERT(!(expr), msg)
17#endif
18
19#define UACPI_BUILD_BUG_ON(expr) \
20 UACPI_BUILD_BUG_ON_WITH_MSG(expr, "BUILD BUG: " #expr " evaluated to true")
21
22#define UACPI_EXPECT_SIZEOF(type, size) \
23 UACPI_BUILD_BUG_ON_WITH_MSG(sizeof(type) != size, \
24 "BUILD BUG: invalid type size")