commit c2a8933a7e192fca3c033c9ece1727d0498f5a23 parent 7de47306ca9ecb9a37410536f50cb261513f266d Author: Evgeny Grin (Karlson2k) <k2k@narod.ru> Date: Wed, 21 Jul 2021 22:08:35 +0300 mhd_align.h: added support for MSVC compiler Diffstat:
| M | src/microhttpd/mhd_align.h | | | 10 | ++++++++++ |
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/microhttpd/mhd_align.h b/src/microhttpd/mhd_align.h @@ -42,6 +42,16 @@ #endif /* HAVE_C_ALIGNOF */ +#ifndef _MHD_ALIGNOF +#if defined(_MSC_VER) && ! defined(__clang__) && _MSC_VER >= 1900 +/* MSVC has the same problem as older GCC versions: + '__alignof()' may return "preferred" alignment instead of "required", + but it is related to floating point variables only. */ +#define _MHD_ALIGNOF(type) __alignof(type) +#endif /* _MSC_VER >= 1900 */ +#endif /* !_MHD_ALIGNOF */ + + #ifdef offsetof #define _MHD_OFFSETOF(strct, membr) offsetof(strct, membr) #else /* ! offsetof */