mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 17:42:51 -06:00
fixes in the headers for use with Microsoft Visual C++
This commit is contained in:
@@ -74,6 +74,8 @@
|
|||||||
|
|
||||||
#ifdef GU_ALIGNOF
|
#ifdef GU_ALIGNOF
|
||||||
# define gu_alignof GU_ALIGNOF
|
# define gu_alignof GU_ALIGNOF
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
# define gu_alignof __alignof
|
||||||
#else
|
#else
|
||||||
# define gu_alignof(t_) \
|
# define gu_alignof(t_) \
|
||||||
((size_t)(offsetof(struct { char c_; t_ e_; }, e_)))
|
((size_t)(offsetof(struct { char c_; t_ e_; }, e_)))
|
||||||
@@ -193,9 +195,13 @@ typedef union {
|
|||||||
void (*fp)();
|
void (*fp)();
|
||||||
} GuMaxAlign;
|
} GuMaxAlign;
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#include <malloc.h>
|
||||||
|
#define gu_alloca(N) alloca(N)
|
||||||
|
#else
|
||||||
#define gu_alloca(N) \
|
#define gu_alloca(N) \
|
||||||
(((union { GuMaxAlign align_; uint8_t buf_[N]; }){{0}}).buf_)
|
(((union { GuMaxAlign align_; uint8_t buf_[N]; }){{0}}).buf_)
|
||||||
|
#endif
|
||||||
|
|
||||||
// For Doxygen
|
// For Doxygen
|
||||||
#define GU_PRIVATE /** @private */
|
#define GU_PRIVATE /** @private */
|
||||||
|
|||||||
Reference in New Issue
Block a user