libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit b6a6f46c9437cc2ffc472b0bfdc45d6c9a5b4d27
parent 75f339b0763ba3b90a4cdaa9076d0870002e24b5
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Mon, 25 Oct 2021 16:55:32 +0300

Fixed builds with MSVS

Diffstat:
Msrc/microhttpd/mhd_align.h | 2+-
Mw32/common/MHD_config.h | 41+++++++++++++++++++++++++++++++++++++----
2 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/src/microhttpd/mhd_align.h b/src/microhttpd/mhd_align.h @@ -42,7 +42,7 @@ #ifndef _MHD_ALIGNOF #if defined(_MSC_VER) && ! defined(__clang__) && _MSC_VER >= 1700 #define _MHD_ALIGNOF(type) __alignof(type) -#endif /* _MSC_VER >= 1900 */ +#endif /* _MSC_VER >= 1700 */ #endif /* !_MHD_ALIGNOF */ #ifdef _MHD_ALIGNOF diff --git a/w32/common/MHD_config.h b/w32/common/MHD_config.h @@ -9,13 +9,13 @@ /* Define if MS VC compiler is used */ #define MSVC 1 -/* Define that MS VC does not support VLAs */ #ifndef __clang__ +/* Define that MS VC does not support VLAs */ +#ifndef __STDC_NO_VLA__ #define __STDC_NO_VLA__ 1 -#endif - +#endif /* ! __STDC_NO_VLA__ */ +#else /* If clang is used then variable-length arrays are supported. */ -#ifdef __clang__ #define HAVE_C_VARARRAYS 1 #endif @@ -33,6 +33,31 @@ #define MHD_HAVE___BUILTIN_BSWAP64 1 #endif /* __clang__ */ +/* The size of `size_t', as computed by sizeof. */ +#if defined(_M_X64) || defined(_M_AMD64) || defined(_M_ARM64) || defined(_WIN64) +#define SIZEOF_SIZE_T 8 +#else /* ! _WIN64 */ +#define SIZEOF_SIZE_T 4 +#endif /* ! _WIN64 */ + +/* The size of `tv_sec' member of `struct timeval', as computed by sizeof */ +#define SIZEOF_STRUCT_TIMEVAL_TV_SEC 4 + +/* The size of `uint64_t', as computed by sizeof. */ +#define SIZEOF_UINT64_T 8 + +/* The size of `unsigned int', as computed by sizeof. */ +#define SIZEOF_UNSIGNED_INT 4 + +/* The size of `unsigned long long', as computed by sizeof. */ +#define SIZEOF_UNSIGNED_LONG_LONG 8 + +/* Define to supported 'noreturn' function declaration */ +#if defined(_STDC_VERSION__) && (__STDC_VERSION__ + 0) >= 201112L +#define _MHD_NORETURN _Noreturn +#else /* before C11 */ +#define _MHD_NORETURN __declspec(noreturn) +#endif /* before C11 */ /* *** MHD configuration *** */ /* Undef to disable feature */ @@ -128,6 +153,14 @@ /* Define to 1 if your compiler supports __func__ magic-macro. */ #define HAVE___FUNC__ 1 +#if _MSC_VER + 0 >= 1900 /* VS 2015 and later */ +#if defined(_STDC_VERSION__) && (__STDC_VERSION__ + 0) >= 201112L +/* Define to 1 if your compiler supports 'alignof()' */ +#define HAVE_C_ALIGNOF 1 +/* Define to 1 if you have the <stdalign.h> header file. */ +#define HAVE_STDALIGN_H 1 +#endif /* C11 */ +#endif /* VS 2015 and later */ /* *** Headers information *** */ /* Not really important as not used by code currently */