3 * Wrapper around libgcrypt's include file gcrypt.h.
4 * For libgcrypt 1.5.0, including gcrypt.h directly brings up lots of
5 * compiler warnings about deprecated definitions.
6 * Try to work around these warnings to ensure a clean build with -Werror.
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 2007 Gerald Combs
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 #ifndef __WSGCRYPT_H__
30 #define __WSGCRYPT_H__
36 #pragma clang diagnostic push
37 #pragma clang diagnostic warning "-Wdeprecated-declarations"
39 #pragma clang diagnostic pop
43 #if defined(__GNUC__) && defined(__GNUC_MINOR__)
44 #define _GCC_VERSION (__GNUC__*100 + __GNUC_MINOR__*10)
46 #define _GCC_VERSION 0
49 /* check the gcc version
50 pragma GCC diagnostic error/warning was introduced in gcc 4.2.0
51 pragma GCC diagnostic push/pop was introduced in gcc 4.6.0 */
55 /* no gcc or gcc version<4.2.0: we can't do anything */
58 #elif _GCC_VERSION<460
60 /* gcc version is between 4.2.0 and 4.6.0:
61 diagnostic warning/error is supported, diagnostic push/pop is not supported */
62 #pragma GCC diagnostic warning "-Wdeprecated-declarations"
64 #pragma GCC diagnostic error "-Wdeprecated-declarations"
68 /* gcc version is >= 4.6.0: we can use push/pop */
69 #pragma GCC diagnostic push
70 #pragma GCC diagnostic warning "-Wdeprecated-declarations"
72 #pragma GCC diagnostic pop
74 #endif /* _GCC_VERSION */
76 #endif /* __CLANG__ */
78 #endif /* HAVE_LIBGRYPT */
80 #endif /* __WSGCRYPT_H__ */