diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2015-06-03 21:27:51 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2015-06-03 21:27:51 +0000 |
commit | 86c904a4be7d31a073e9943afbc08dbf0de5ef4f (patch) | |
tree | 98e8e466e8174c29e4045608b85e8627e94f46ca /src/include | |
parent | 4d75ef33219d976bdc3e053c872c752d457872a2 (diff) | |
download | libmicrohttpd-86c904a4be7d31a073e9943afbc08dbf0de5ef4f.tar.gz libmicrohttpd-86c904a4be7d31a073e9943afbc08dbf0de5ef4f.zip |
microhttpd.h: add defines for deprecating macros
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/microhttpd.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 6107067e..2087a2da 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -194,6 +194,34 @@ typedef SOCKET MHD_socket; | |||
194 | #endif /* MHD_SOCKET_DEFINED */ | 194 | #endif /* MHD_SOCKET_DEFINED */ |
195 | 195 | ||
196 | /** | 196 | /** |
197 | * Define MHD_NO_DEPRECATION before including "microhttpd.h" to disable deprecation messages | ||
198 | */ | ||
199 | #ifdef MHD_NO_DEPRECATION | ||
200 | #define _MHD_DEPR_MACRO(msg) | ||
201 | #endif /* MHD_NO_DEPRECATION */ | ||
202 | |||
203 | #ifndef _MHD_DEPR_MACRO | ||
204 | #if defined(_MSC_FULL_VER) && _MSC_VER+0 >= 1500 | ||
205 | /* Stringify macros */ | ||
206 | #define _MHD_INSTRMACRO(a) #a | ||
207 | #define _MHD_STRMACRO(a) _MHD_INSTRMACRO(a) | ||
208 | #define _MHD_DEPR_MACRO(msg) __pragma(message(__FILE__ "(" _MHD_STRMACRO(__LINE__)"): warning: " msg)) | ||
209 | #elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__) | ||
210 | #define _MHD_GCC_PRAG(x) _Pragma (#x) | ||
211 | #if __clang_major__+0 >= 5 || \ | ||
212 | (!defined(__apple_build_version__) && (__clang_major__+0 > 3 || (__clang_major__+0 == 3 && __clang_minor__ >= 3))) || \ | ||
213 | __GNUC__+0 > 4 || (__GNUC__+0 == 4 && __GNUC_MINOR__+0 >= 8) | ||
214 | #define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(GCC warning msg) | ||
215 | #else /* older clang or GCC */ | ||
216 | #define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG(message msg) | ||
217 | #endif | ||
218 | /* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */ | ||
219 | #else /* other compilers */ | ||
220 | #define _MHD_DEPR_MACRO(msg) | ||
221 | #endif | ||
222 | #endif /* _MHD_DEPR_MACRO */ | ||
223 | |||
224 | /** | ||
197 | * Not all architectures and `printf()`'s support the `long long` type. | 225 | * Not all architectures and `printf()`'s support the `long long` type. |
198 | * This gives the ability to replace `long long` with just a `long`, | 226 | * This gives the ability to replace `long long` with just a `long`, |
199 | * standard `int` or a `short`. | 227 | * standard `int` or a `short`. |