summaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorkrangelov <kr.angelov@gmail.com>2019-02-18 11:39:21 +0100
committerkrangelov <kr.angelov@gmail.com>2019-02-18 11:39:21 +0100
commit1d1e65185a88928a1066efbcf071ee528529136c (patch)
tree66d229f56aa110da2848fee8771edb76a89daf16 /src/runtime
parentc32cd7133f0e2e370998ed8ca863133133dfde57 (diff)
fixes in the headers for use with Microsoft Visual C++
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/c/gu/defs.h8
1 files changed, 7 insertions, 1 deletions
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 <malloc.h>
+#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 */