MSWSP: give names to PropertySet ids
[wireshark-wip.git] / wsutil / wsgcrypt.h
blobd97d8e20ab06dc944244b3b222b03c2c48f61353
1 /* wsgcrypt.h
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.
8 * $Id$
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__
32 #ifdef HAVE_LIBGCRYPT
34 #ifdef __CLANG__
36 #pragma clang diagnostic push
37 #pragma clang diagnostic warning "-Wdeprecated-declarations"
38 #include <gcrypt.h>
39 #pragma clang diagnostic pop
41 #else
43 #if defined(__GNUC__) && defined(__GNUC_MINOR__)
44 #define _GCC_VERSION (__GNUC__*100 + __GNUC_MINOR__*10)
45 #else
46 #define _GCC_VERSION 0
47 #endif
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 */
53 #if _GCC_VERSION<420
55 /* no gcc or gcc version<4.2.0: we can't do anything */
56 #include <gcrypt.h>
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"
63 #include <gcrypt.h>
64 #pragma GCC diagnostic error "-Wdeprecated-declarations"
66 #else
68 /* gcc version is >= 4.6.0: we can use push/pop */
69 #pragma GCC diagnostic push
70 #pragma GCC diagnostic warning "-Wdeprecated-declarations"
71 #include <gcrypt.h>
72 #pragma GCC diagnostic pop
74 #endif /* _GCC_VERSION */
76 #endif /* __CLANG__ */
78 #endif /* HAVE_LIBGRYPT */
80 #endif /* __WSGCRYPT_H__ */