commit 86c904a4be7d31a073e9943afbc08dbf0de5ef4f parent 4d75ef33219d976bdc3e053c872c752d457872a2 Author: Evgeny Grin (Karlson2k) <k2k@narod.ru> Date: Wed, 3 Jun 2015 21:27:51 +0000 microhttpd.h: add defines for deprecating macros Diffstat:
| M | src/include/microhttpd.h | | | 28 | ++++++++++++++++++++++++++++ |
1 file changed, 28 insertions(+), 0 deletions(-)
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h @@ -194,6 +194,34 @@ typedef SOCKET MHD_socket; #endif /* MHD_SOCKET_DEFINED */ /** + * Define MHD_NO_DEPRECATION before including "microhttpd.h" to disable deprecation messages + */ +#ifdef MHD_NO_DEPRECATION +#define _MHD_DEPR_MACRO(msg) +#endif /* MHD_NO_DEPRECATION */ + +#ifndef _MHD_DEPR_MACRO +#if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1500 +/* Stringify macros */ +#define _MHD_INSTRMACRO(a) #a +#define _MHD_STRMACRO(a) _MHD_INSTRMACRO(a) +#define _MHD_DEPR_MACRO(msg) __pragma(message(__FILE__ "(" _MHD_STRMACRO(__LINE__)"): warning: " msg)) +#elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__) +#define _MHD_GCC_PRAG(x) _Pragma (#x) +#if __clang_major__+0 >= 5 || \ + (!defined(__apple_build_version__) && (__clang_major__+0 > 3 || (__clang_major__+0 == 3 && __clang_minor__ >= 3))) || \ + __GNUC__+0 > 4 || (__GNUC__+0 == 4 && __GNUC_MINOR__+0 >= 8) +#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(GCC warning msg) +#else /* older clang or GCC */ +#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(message msg) +#endif +/* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */ +#else /* other compilers */ +#define _MHD_DEPR_MACRO(msg) +#endif +#endif /* _MHD_DEPR_MACRO */ + +/** * Not all architectures and `printf()`'s support the `long long` type. * This gives the ability to replace `long long` with just a `long`, * standard `int` or a `short`.