endif()
endif()
-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
- set (C_UNUSED "__attribute__((unused))" )
- set (WS_NORETURN "__attribute__((noreturn))")
-elseif(MSVC)
- set (C_UNUSED "")
- set (WS_NORETURN "__declspec(noreturn)")
-else()
- set (C_UNUSED "")
- set (WS_NORETURN "")
-endif()
-
set(WIRESHARK_LD_FLAGS
-Wl,--as-needed
# -flto
fileset.h \
frame_tvbuff.h \
register.h \
- ws_symbol_export.h
+ ws_symbol_export.h \
+ ws_attributes.h
# wireshark specifics
WIRESHARK_COMMON_SRC = \
#include <stdarg.h>
#include "conditions.h"
#include "capture_stop_conditions.h"
+#include "ws_attributes.h"
/* predefined classes function prototypes */
static condition* _cnd_constr_timeout(condition*, va_list);
#include <sys/socket.h>
#endif
+#include "ws_attributes.h"
+
/*
* Linux bonding devices mishandle unknown ioctls; they fail
* with ENODEV rather than ENOTSUP, EOPNOTSUPP, or ENOTTY,
#ifdef HAVE_LIBPCAP
#include <caputils/iface_monitor.h>
+#include "ws_attributes.h"
#if defined(HAVE_LIBNL)
extern "C" {
#endif /* __cplusplus */
+#include "ws_attributes.h"
+
enum ws80211_channel_type {
WS80211_CHAN_NO_HT,
WS80211_CHAN_HT20,
/* Note: not use in the code */
#cmakedefine YYTEXT_POINTER
-/* _U_ isn't needed for C++, simply don't name the variable.
- However, we do need it for some headers that are shared between C and C++. */
-#define _U_ ${C_UNUSED}
-
-/* Hint to the compiler that a function never returns */
-#define WS_NORETURN @WS_NORETURN@
-
#if defined(_WIN32)
/* WpdPack/INclude/pcap/pcap.h checks for "#if defined(WIN32)" */
#include "G711adecode.h"
#include "G711atable.h"
+#include "ws_attributes.h"
+
void *
codec_g711a_init(void)
{
#include "G711udecode.h"
#include "G711utable.h"
+#include "ws_attributes.h"
+
void *
codec_g711u_init(void)
{
#include "spandsp.h"
#include "G722decode.h"
+#include "ws_attributes.h"
+
void *
codec_g722_init(void)
{
#include "spandsp.h"
#include "G726decode.h"
+#include "ws_attributes.h"
+
typedef struct _g726_codec_ctx {
g726_state_t *state;
int bit_rate;
#include "bcg729/decoder.h"
#include "G729decode.h"
+#include "ws_attributes.h"
+
void *
codec_g729_init(void)
{
#ifndef _CODECS_H_
#define _CODECS_H_
-#include <config.h>
-
#include <epan/epan.h>
#include "ws_symbol_export.h"
+#include "ws_attributes.h"
#ifdef __cplusplus
extern "C" {
#include <math.h>
#include <limits.h>
+#include "ws_attributes.h"
+
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include <stdlib.h>
#include <stdarg.h>
#include "conditions.h"
+#include "ws_attributes.h"
/* container for condition classes */
static GHashTable *classes = NULL;
AM_CONDITIONAL(SSE42_SUPPORTED, test "x$have_sse42" = "xyes")
AC_SUBST(CFLAGS_SSE42)
-#
-# If we're running GCC or clang define _U_ to be "__attribute__((unused))"
-# so we can use _U_ to flag unused function parameters and not get warnings
-# about them. Otherwise, define _U_ to be an empty string so that _U_ used
-# to flag an unused function parameters will compile with other compilers.
-#
-# XXX - similar hints for other compilers?
-#
-if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
- AC_DEFINE(_U_, __attribute__((unused)), [Hint to the compiler that a function parameters is not used])
- AC_DEFINE(WS_NORETURN, __attribute((noreturn)), [Hint to the compiler that a function never returns])
-else
- AC_DEFINE(_U_, , [Hint to the compiler that a function parameters is not used])
- AC_DEFINE(WS_NORETURN, , [Hint to the compiler that a function never returns])
-fi
-
# If we're running GCC or CLang, use FORTIFY_SOURCE=2
# (only if the GCC 'optimization level' > 0).
#
usr/lib/*/libwsutil.so
ws_symbol_export.h usr/include/wireshark
ws_diag_control.h usr/include/wireshark
+ws_attributes.h usr/include/wireshark
wsutil/*.h usr/include/wireshark/wsutil
#include <glib.h>
#include "asm_utils.h"
+#include "ws_attributes.h"
/* String comparison func for dfilter_token GTree */
gint
#include <glib.h>
#include "ws_symbol_export.h"
+#include "ws_attributes.h"
/* Please don't directly manipulate these structs. Please use
* the methods provided. If you REALLY can't do what you need to
#include <glib.h>
+#include "ws_attributes.h"
+
void
sttype_set_replace_element(stnode_t *node, stnode_t *oldnode, stnode_t *newnode);
#include "config.h"
#include "packet-epl.h"
+#include "ws_attributes.h"
#include <wsutil/ws_printf.h>
#include <epan/range.h>
#ifndef SNORT_CONFIG_H
#define SNORT_CONFIG_H
+#include "ws_attributes.h"
+
/************************************************************************/
/* Rule related data types */
#include <glib.h>
#include <stdlib.h> /* exit() */
+#include "ws_attributes.h"
typedef struct _dtd_build_data_t {
gchar* proto_name;
#include <stdlib.h>
#include <assert.h>
#include "ws_symbol_export.h"
+#include "ws_attributes.h"
#define XCEPT_GROUP_ANY 0
#define XCEPT_CODE_ANY 0
#ifndef EXPORTED_PDU_H
#define EXPORTED_PDU_H
-#include <config.h>
-
#include "ws_symbol_export.h"
+#include "ws_attributes.h"
#include <glib.h>
#ifndef EPAN_PLUGIN_IF_H
#define EPAN_PLUGIN_IF_H
-#include <config.h>
-
#include "ws_symbol_export.h"
+#include "ws_attributes.h"
#include <glib.h>
#include <epan/epan.h>
#include "ftypes/ftypes.h"
#include "register.h"
#include "ws_symbol_export.h"
+#include "ws_attributes.h"
#ifdef __cplusplus
extern "C" {
#include <string.h>
#include <glib.h>
#include <ws_symbol_export.h>
+#include "ws_attributes.h"
#ifdef __cplusplus
extern "C" {
#ifndef HAVE_GETOPT_LONG
#include "wsutil/wsgetopt.h"
#endif
+#include "ws_attributes.h"
enum extcap_options {
EXTCAP_BASE_OPTIONS_ENUM
#include "extcap.h"
#include "extcap_parser.h"
+#include "ws_attributes.h"
void extcap_printf_complex(extcap_complex *comp) {
gchar *ret = extcap_get_complex_as_string(comp);
#include <stdlib.h>
#include <assert.h>
+#include "ws_attributes.h"
+
#define ISSPACE(X) isspace((unsigned char)(X))
#define ISDIGIT(X) isdigit((unsigned char)(X))
#define ISALNUM(X) isalnum((unsigned char)(X))
#include <epan/funnel.h>
#include <stdio.h>
+#include "ws_attributes.h"
+
void register_tap_listener_funnel(void);
struct _funnel_text_window_t {
*/
#include "capture_opts.h"
#include <gtk/gtk.h>
+#include "ws_attributes.h"
#define CR_MAIN_NB "compile_results_main_notebook"
#define __HELP_DLG_H__
#include "ui/help_url.h"
+#include "ws_attributes.h"
/** @file
* "Help" dialog box.
#include <wsutil/nstime.h>
#include "wtap_opttypes.h"
#include "ws_symbol_export.h"
+#include "ws_attributes.h"
#ifdef __cplusplus
extern "C" {
--- /dev/null
+/* ws_attributes.h
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __WS_ATTRIBUTES_H__
+#define __WS_ATTRIBUTES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/*
+ * If we're running GCC or clang define _U_ to be "__attribute__((unused))"
+ * so we can use _U_ to flag unused function parameters and not get warnings
+ * about them. Otherwise, define _U_ to be an empty string so that _U_ used
+ * to flag an unused function parameters will compile with other compilers.
+ *
+ * XXX - similar hints for other compilers?
+ */
+
+#if defined(__GNUC__)
+ /* This includes clang */
+ #define _U_ __attribute__((unused))
+#else
+ #define _U_
+#endif
+
+/* Hint to the compiler that a function never returns */
+#if defined(__GNUC__)
+ /* This includes clang */
+ #define WS_NORETURN __attribute__((noreturn))
+#elif defined(_MSC_VER)
+ #define WS_NORETURN __declspec(noreturn)
+#else
+ #define WS_NORETURN
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __WS_ATTRIBUTES_H__ */
#ifndef __WSUTIL_BITS_COUNT_ONES_H__
#define __WSUTIL_BITS_COUNT_ONES_H__
-#include "config.h"
-
#include <glib.h>
/*
#define __CRASH_INFO_H__
#include "ws_symbol_export.h"
+#include "ws_attributes.h"
#ifdef __cplusplus
extern "C" {
#define FILESYSTEM_H
#include "ws_symbol_export.h"
+#include "ws_attributes.h"
#ifdef __cplusplus
extern "C" {
#ifndef __WS_INET_ADDR_INT_H__
#define __WS_INET_ADDR_INT_H__
-#include "config.h"
-
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifndef __POPCOUNT_H__
#define __POPCOUNT_H__
-#include "config.h"
-
#include "ws_symbol_export.h"
WS_DLL_PUBLIC int popcount(unsigned int mask);
#ifndef __SOCKET_H__
#define __SOCKET_H__
-#include "config.h"
-
#if defined(_WIN32) && !defined(__CYGWIN__)
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#ifndef __UNICODEUTIL_H__
#define __UNICODEUTIL_H__
-#include <config.h>
-
#include "ws_symbol_export.h"
#include <glib.h>
#ifndef __WIN32UTIL_H__
#define __WIN32UTIL_H__
-#include <config.h>
-
#include "ws_symbol_export.h"
#include <glib.h>