mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Replace the old STATIC_ASSERT macro with static_assert
This commit is contained in:
parent
8b108ed5f2
commit
9c348d057e
4 changed files with 8 additions and 20 deletions
|
@ -42,18 +42,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
C(C &&other) = default; \
|
||||
C &operator=(C &&) = default;
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#define UNUSED_ATTRIBUTE __attribute__ ((unused))
|
||||
#else
|
||||
#define UNUSED_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
// Fail compilation if condition expr is not met.
|
||||
// Note that 'msg' must follow the format of a valid identifier, e.g.
|
||||
// STATIC_ASSERT(sizeof(foobar_t) == 40), foobar_t_is_wrong_size);
|
||||
#define STATIC_ASSERT(expr, msg) \
|
||||
UNUSED_ATTRIBUTE typedef char msg[!!(expr) * 2 - 1]
|
||||
|
||||
// Macros to facilitate writing position vectors to a stream
|
||||
// Usage:
|
||||
// v3s16 pos(1,2,3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue