libmicrohttpd

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

commit 0a374c71b8f7fccd1682f6f6d6b967fdd6e2502b
parent eb76464cdf0164ae68c53c6b017d261a715a93c5
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Sat, 24 Apr 2021 23:00:06 +0300

Updates for MSVC builds

Diffstat:
Msrc/include/autoinit_funcs.h | 9+++++----
Mw32/common/MHD_config.h | 62+++++++++++++++++++++++++++++++++++++++++++++-----------------
Mw32/common/libmicrohttpd-filters.vcxproj | 6++++++
3 files changed, 56 insertions(+), 21 deletions(-)

diff --git a/src/include/autoinit_funcs.h b/src/include/autoinit_funcs.h @@ -64,12 +64,12 @@ #define AUTOINIT_FUNCS_INCLUDED 1 /** -* Current version of the header. +* Current version of the header in packed BCD form. * 0x01093001 = 1.9.30-1. */ -#define AUTOINIT_FUNCS_VERSION 0x01000100 +#define AUTOINIT_FUNCS_VERSION 0x01000200 -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) /* if possible - check for supported attribute */ #ifdef __has_attribute #if ! __has_attribute (constructor) || ! __has_attribute (destructor) @@ -80,7 +80,8 @@ /* "_attribute__ ((constructor))" is supported by GCC, clang and Sun/Oracle compiler starting from version 12.1. */ -#if (defined(__GNUC__) && ! defined(_GNUC_ATTR_CONSTR_NOT_SUPPORTED)) || \ +#if ((defined(__GNUC__) || defined(__clang__)) && \ + ! defined(_GNUC_ATTR_CONSTR_NOT_SUPPORTED)) || \ (defined(__SUNPRO_C) && __SUNPRO_C + 0 >= 0x5100) #define GNUC_SET_INIT_AND_DEINIT(FI,FD) \ diff --git a/w32/common/MHD_config.h b/w32/common/MHD_config.h @@ -14,12 +14,25 @@ #define __STDC_NO_VLA__ 1 #endif +/* If clang is used then variable-length arrays are supported. */ +#ifdef __clang__ +#define HAVE_C_VARARRAYS 1 +#endif + /* Define to 1 if your C compiler supports inline functions. */ #define INLINE_FUNC 1 /* Define to prefix which will be used with MHD inline functions. */ #define _MHD_static_inline static __forceinline +#ifdef __clang__ +/* Define to 1 if you have __builtin_bswap32() builtin function */ +#define MHD_HAVE___BUILTIN_BSWAP32 1 + +/* Define to 1 if you have __builtin_bswap64() builtin function */ +#define MHD_HAVE___BUILTIN_BSWAP64 1 +#endif /* __clang__ */ + /* *** MHD configuration *** */ /* Undef to disable feature */ @@ -88,6 +101,33 @@ #define HAVE_INTTYPES_H 1 #endif +#if _MSC_VER + 0 >= 1800 /* VS 2013 and later */ +/* Define to 1 if you have the <stdbool.h> header file and <stdbool.h> defines + 'bool' type. */ +#define HAVE_STDBOOL_H 1 +#else /* before VS 2013 */ + +/* Define to type name which will be used as boolean type. */ +#define bool int + +/* Define to value interpreted by compiler as boolean "false", if "false" is + not defined by system headers. */ +#define false 0 + +/* Define to value interpreted by compiler as boolean "true", if "true" is not + defined by system headers. */ +#define true (!0) +#endif /* before VS 2013 */ + +/* Define to 1 if you have the `getsockname' function. */ +#define HAVE_GETSOCKNAME 1 + +/* Define if you have usable `getsockname' function. */ +#define MHD_USE_GETSOCKNAME 1 + +/* Define to 1 if your compiler supports __func__ magic-macro. */ +#define HAVE___FUNC__ 1 + /* *** Headers information *** */ /* Not really important as not used by code currently */ @@ -110,6 +150,9 @@ /* Define to 1 if you have the <math.h> header file. */ #define HAVE_MATH_H 1 +/* Define to 1 if you have the <sdkddkver.h> header file. */ +#define HAVE_SDKDDKVER_H 1 + /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 @@ -140,23 +183,8 @@ /* Define to 1 if you have the <stddef.h> header file. */ #define HAVE_STDDEF_H 1 -#if _MSC_VER+0 >= 1800 /* VS 2013 and later */ -/* Define to 1 if you have the <stdbool.h> header file and <stdbool.h> defines - 'bool' type. */ -#define HAVE_STDBOOL_H 1 -#else /* before VS 2013 */ - -/* Define to type name which will be used as boolean type. */ -#define bool int - -/* Define to value interpreted by compiler as boolean "false", if "false" is - not defined by system headers. */ -#define false 0 - -/* Define to value interpreted by compiler as boolean "true", if "true" is not - defined by system headers. */ -#define true (!0) -#endif /* before VS 2013 */ +/* Define to 1 if you have the <windows.h> header file. */ +#define HAVE_WINDOWS_H 1 /* *** Other useful staff *** */ diff --git a/w32/common/libmicrohttpd-filters.vcxproj b/w32/common/libmicrohttpd-filters.vcxproj @@ -153,6 +153,12 @@ <ClCompile Include="$(MhdSrc)microhttpd\mhd_itc.c"> <Filter>Source Files</Filter> </ClCompile> + <ClInclude Include="$(MhdSrc)microhttpd\mhd_send.h"> + <Filter>Source Files</Filter> + </ClInclude> + <ClCompile Include="$(MhdSrc)microhttpd\mhd_send.c"> + <Filter>Source Files</Filter> + </ClCompile> <ClInclude Include="$(MhdSrc)microhttpd\mhd_compat.h"> <Filter>Source Files</Filter> </ClInclude>