3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
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.
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.
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.
22 #ifndef __WS_ATTRIBUTES_H__
23 #define __WS_ATTRIBUTES_H__
27 #endif /* __cplusplus */
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.
35 * XXX - similar hints for other compilers?
39 /* This includes clang */
40 #define _U_ __attribute__((unused))
45 /* Hint to the compiler that a function never returns */
47 /* This includes clang */
48 #define WS_NORETURN __attribute__((noreturn))
49 #elif defined(_MSC_VER)
50 #define WS_NORETURN __declspec(noreturn)
57 #endif /* __cplusplus */
59 #endif /* __WS_ATTRIBUTES_H__ */