libmicrohttpd

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

commit da7012adc958daf558f3dd699c11725b3c414e3f
parent c8acb9ceb645d60b2c1d6d3af461c445f2254c49
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Tue, 27 Oct 2015 12:23:42 +0000

Update deprecation macros for new GCC, better support old clang

Diffstat:
MChangeLog | 4++++
Msrc/include/microhttpd.h | 10+++++++---
2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,7 @@ +Tue Oct 27 12:08:02 CET 2015 + Rework deprecation maros: fix errors with old GCC versions, + improved support for old clang and new GCC. -EG + Sun Oct 25 23:05:32 CET 2015 Return correct header kind in MHD_get_connection_values() even if a bitmask is used for the "kind" argument. -FC/CG diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h @@ -217,6 +217,10 @@ typedef SOCKET MHD_socket; #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg) #else /* older clang or GCC */ #define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(message msg) +#if (__clang_major__+0 > 2 || (__clang_major__+0 == 2 && __clang_minor__ >= 9)) /* FIXME: earlier versions not tested */ +/* clang handles inline pragmas better than GCC */ +#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO(msg) +#endif /* clang >= 2.9 */ #endif /* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */ #else /* other compilers */ @@ -235,11 +239,11 @@ typedef SOCKET MHD_socket; #elif defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1310 /* VS .NET 2003 deprecation do not support custom messages */ #define _MHD_DEPR_FUNC(msg) __declspec(deprecated) -#elif defined (__clang__) && \ - (__clang_major__+0 >= 4 || (!defined(__apple_build_version__) && __clang_major__+0 >= 3)) +#elif (__GNUC__+0 >= 5) || (defined (__clang__) && \ + (__clang_major__+0 >= 4 || (!defined(__apple_build_version__) && __clang_major__+0 >= 3))) #define _MHD_DEPR_FUNC(msg) __attribute__((deprecated(msg))) #elif defined (__clang__) || __GNUC__+0 > 3 || (__GNUC__+0 == 3 && __GNUC_MINOR__+0 >= 1) -/* GCC-style deprecation do not support custom messages */ +/* old GCC-style deprecation do not support custom messages */ #define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__)) /* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */ #else /* other compilers */