mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
MSVC: Avoid variadic macro bug in STATIC_ASSERT
MSVC does not handle __VA_ARGS__ as expected in STATIC_ASSERT, avoid its use to work around it since we don't need it. The underlying issue seems to be one of https://connect.microsoft.com/VisualStudio/Feedback/Details/1232378 https://connect.microsoft.com/VisualStudio/Feedback/Details/1099052 The bug only seems to manifest when using multiple variadic macros that call each other.
This commit is contained in:
parent
3dc8cdc150
commit
2a8ceb160c
@ -46,10 +46,10 @@
|
|||||||
|
|
||||||
#define STATIC_ASSERT_PRAGMA_START
|
#define STATIC_ASSERT_PRAGMA_START
|
||||||
#define STATIC_ASSERT_PRAGMA_END
|
#define STATIC_ASSERT_PRAGMA_END
|
||||||
#define STATIC_ASSERT(...) \
|
#define STATIC_ASSERT(cond, msg) \
|
||||||
do { \
|
do { \
|
||||||
STATIC_ASSERT_PRAGMA_START \
|
STATIC_ASSERT_PRAGMA_START \
|
||||||
STATIC_ASSERT_STATEMENT(__VA_ARGS__); \
|
STATIC_ASSERT_STATEMENT(cond, msg); \
|
||||||
STATIC_ASSERT_PRAGMA_END \
|
STATIC_ASSERT_PRAGMA_END \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user