From 1d1e65185a88928a1066efbcf071ee528529136c Mon Sep 17 00:00:00 2001 From: krangelov Date: Mon, 18 Feb 2019 11:39:21 +0100 Subject: [PATCH] fixes in the headers for use with Microsoft Visual C++ --- src/runtime/c/gu/defs.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/runtime/c/gu/defs.h b/src/runtime/c/gu/defs.h index a7fd04aad..15bd9e57b 100644 --- a/src/runtime/c/gu/defs.h +++ b/src/runtime/c/gu/defs.h @@ -74,6 +74,8 @@ #ifdef GU_ALIGNOF # define gu_alignof GU_ALIGNOF +#elif defined(_MSC_VER) +# define gu_alignof __alignof #else # define gu_alignof(t_) \ ((size_t)(offsetof(struct { char c_; t_ e_; }, e_))) @@ -193,9 +195,13 @@ typedef union { void (*fp)(); } GuMaxAlign; +#if defined(_MSC_VER) +#include +#define gu_alloca(N) alloca(N) +#else #define gu_alloca(N) \ (((union { GuMaxAlign align_; uint8_t buf_[N]; }){{0}}).buf_) - +#endif // For Doxygen #define GU_PRIVATE /** @private */