lorawan: Fix Join Request and Join Accept
[metze/wireshark/wip.git] / ws_attributes.h
1 /* ws_attributes.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef __WS_ATTRIBUTES_H__
23 #define __WS_ATTRIBUTES_H__
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 /*
30  * If we're running GCC or clang define _U_ to be "__attribute__((unused))"
31  * so we can use _U_ to flag unused function parameters and not get warnings
32  * about them. Otherwise, define _U_ to be an empty string so that _U_ used
33  * to flag an unused function parameters will compile with other compilers.
34  *
35  * XXX - similar hints for other compilers?
36  */
37
38 #if defined(__GNUC__)
39   /* This includes clang */
40   #define _U_ __attribute__((unused))
41 #else
42   #define _U_
43 #endif
44
45 /* Hint to the compiler that a function never returns */
46 #if defined(__GNUC__)
47   /* This includes clang */
48   #define WS_NORETURN __attribute__((noreturn))
49 #elif defined(_MSC_VER)
50   #define WS_NORETURN __declspec(noreturn)
51 #else
52   #define WS_NORETURN
53 #endif
54
55 #ifdef __cplusplus
56 }
57 #endif /* __cplusplus */
58
59 #endif /* __WS_ATTRIBUTES_H__ */