Move more headers outside extern "C".

If a header declares a function, or anything else requiring the extern
"C" decoration, have it wrap the declaration itself; don't rely on the
header itself being included inside extern "C".
This commit is contained in:
Guy Harris 2021-03-16 02:36:10 -07:00
parent a892a161d7
commit 1e1f4e6b5f
17 changed files with 62 additions and 56 deletions

View File

@ -12,12 +12,12 @@
#include "ws_symbol_export.h"
#include <wsutil/color.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <wsutil/color.h>
struct epan_dissect;
#define COLORFILTERS_FILE_NAME "colorfilters"

View File

@ -13,6 +13,8 @@
#include "ws_symbol_export.h"
#include "packet.h" /* for conversation dissector type */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@ -46,8 +48,6 @@ extern "C" {
/* Flags to handle endpoints */
#define USE_LAST_ENDPOINT 0x08 /* Use last endpoint created, regardless of type */
#include "packet.h" /* for conversation dissector type */
/* Types of port numbers Wireshark knows about. */
typedef enum {
ENDPOINT_NONE, /* no endpoint */

View File

@ -12,10 +12,6 @@
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/tvbuff.h>
#include <epan/prefs.h>
#include <epan/frame_data.h>
@ -23,6 +19,9 @@ extern "C" {
#include <epan/register.h>
#include "ws_symbol_export.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** Global variable holding the content of the corresponding environment variable
* to save fetching it repeatedly.

View File

@ -10,15 +10,15 @@
#ifndef EPAN_DISSECT_H
#define EPAN_DISSECT_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "epan.h"
#include "tvbuff.h"
#include "proto.h"
#include "packet_info.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Dissection of a single byte array. Holds tvbuff info as
* well as proto_tree info. As long as the epan_dissect_t for a byte
* array is in existence, you must not free or move that byte array,

View File

@ -13,12 +13,12 @@
#include "ws_symbol_export.h"
#include <epan/value_string.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/value_string.h>
/*
* Maximum length of an IEEE 802.3 frame; Ethernet type/length values
* less than or equal to it are lengths.

View File

@ -13,10 +13,6 @@
#ifndef __FOLLOW_H__
#define __FOLLOW_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/epan.h>
#include <epan/packet.h>
#include <epan/ipv6.h>
@ -24,6 +20,10 @@ extern "C" {
#include <epan/wmem/wmem.h>
#include "ws_symbol_export.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef enum {
TCP_STREAM = 0,
UDP_STREAM,

View File

@ -11,16 +11,16 @@
#ifndef __FRAME_DATA_H__
#define __FRAME_DATA_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <ws_diag_control.h>
#include <ws_symbol_export.h>
#include <wsutil/nstime.h>
#include <wiretap/wtap.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
struct _packet_info;
struct epan_session;

View File

@ -25,6 +25,9 @@ typedef struct _e_guid_t {
guint8 data4[8];
} e_guid_t;
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
WS_DLL_PUBLIC void guids_init(void);
@ -50,4 +53,8 @@ WS_DLL_PUBLIC const gchar* guids_resolve_guid_to_str(const e_guid_t *guid);
WS_DLL_PUBLIC int guid_cmp(const e_guid_t *g1, const e_guid_t *g2);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GUID_UTILS_H__ */

View File

@ -13,15 +13,15 @@
#ifndef __MAXMIND_DB_H__
#define __MAXMIND_DB_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/prefs.h>
#include <wsutil/inet_ipv4.h>
#include <wsutil/inet_ipv6.h>
#include "ws_symbol_export.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _mmdb_lookup_t {
gboolean found;
const char *country;

View File

@ -13,15 +13,15 @@
#ifndef __OIDS_H__
#define __OIDS_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/ftypes/ftypes.h>
#include <epan/prefs.h>
#include <epan/wmem/wmem.h>
#include "ws_symbol_export.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
*@file
*/

View File

@ -12,14 +12,14 @@
#ifndef __PREFS_INT_H__
#define __PREFS_INT_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <stdio.h>
#include "ws_symbol_export.h"
#include <epan/wmem/wmem.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
*@file
*/

View File

@ -13,10 +13,6 @@
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/params.h>
#include <epan/range.h>
@ -24,6 +20,10 @@ extern "C" {
#include "ws_symbol_export.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define DEF_WIDTH 750
#define DEF_HEIGHT 550

View File

@ -11,12 +11,12 @@
#ifndef __PROTO_DATA_H__
#define __PROTO_DATA_H__
#include "ws_symbol_export.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "ws_symbol_export.h"
/** @file
* Dissected packet data and metadata.
*/

View File

@ -15,14 +15,14 @@
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <stdio.h>
#include <stdarg.h>
#include "ws_attributes.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define PBL_DEFAULT_PACKAGE_NAME ""
typedef void(*pbl_report_error_cb_t)(const char *msg_format, ...);

View File

@ -11,13 +11,13 @@
#ifndef __RTP_PT_H__
#define __RTP_PT_H__
#include <epan/value_string.h>
#include "ws_symbol_export.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <epan/value_string.h>
#include "ws_symbol_export.h"
/*
* RTP Payload types
* Table B.2 / H.225.0

View File

@ -13,6 +13,12 @@
#include "ws_symbol_export.h"
#include <epan/params.h>
#include <epan/stat_groups.h>
#include <epan/packet_info.h>
#include <epan/tap.h>
#include <epan/wmem/wmem.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@ -21,12 +27,6 @@ extern "C" {
* Parameters for taps.
*/
#include <epan/params.h>
#include <epan/stat_groups.h>
#include <epan/packet_info.h>
#include <epan/tap.h>
#include <epan/wmem/wmem.h>
typedef enum {
PARAM_UINT, /* Unused? */
PARAM_STRING, /* Unused? */

View File

@ -13,13 +13,13 @@
#include <glib.h>
#include "ws_symbol_export.h"
#include "wmem/wmem.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "ws_symbol_export.h"
#include "wmem/wmem.h"
/* VALUE TO STRING MATCHING */
typedef struct _value_string {