From 5fa7d37e377abb89e317f4ebd47ebea69ebe0fd9 Mon Sep 17 00:00:00 2001 From: Jakub Zawadzki Date: Tue, 10 Dec 2013 19:13:09 +0000 Subject: [PATCH] Fix epan building with undefined HAVE_PLUGINS + guard prototypes with HAVE_PLUGINS in .h files to get errors before linking. svn path=/trunk/; revision=53909 --- epan/epan.c | 2 ++ epan/proto.h | 4 ++++ epan/tap.h | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/epan/epan.c b/epan/epan.c index b52244c921..71191ecef2 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -85,8 +85,10 @@ epan_get_version(void) { void epan_register_plugin_types(void) { +#ifdef HAVE_PLUGINS register_dissector_plugin_type(); register_tap_plugin_type(); +#endif } void diff --git a/epan/proto.h b/epan/proto.h index f840403972..b6a091dab7 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -37,6 +37,8 @@ #ifndef __PROTO_H__ #define __PROTO_H__ +#include "config.h" + #ifdef HAVE_STDARG_H # include #else @@ -612,9 +614,11 @@ WS_DLL_PUBLIC void proto_tree_children_foreach(proto_tree *tree, /** Retrieve the wmem_allocator_t from a proto_node */ #define PNODE_POOL(proto_node) ((proto_node)->tree_data->pinfo->pool) +#ifdef HAVE_PLUGINS /** Register dissector plugin type with the plugin system. Called by epan_register_plugin_types(); do not call it yourself. */ extern void register_dissector_plugin_type(void); +#endif /** Sets up memory used by proto routines. Called at program startup */ void proto_init(void (register_all_protocols_func)(register_cb cb, gpointer client_data), diff --git a/epan/tap.h b/epan/tap.h index 692cd39c22..ea413f38db 100644 --- a/epan/tap.h +++ b/epan/tap.h @@ -25,6 +25,8 @@ #ifndef __TAP_H__ #define __TAP_H__ +#include "config.h" + #include #include "ws_symbol_export.h" @@ -46,9 +48,11 @@ typedef void (*tap_draw_cb)(void *tapdata); #define TL_IS_DISSECTOR_HELPER 0x00000004 /**< tap helps a dissector do work ** but does not, itself, require dissection */ +#ifdef HAVE_PLUGINS /** Register tap plugin type with the plugin system. Called by epan_register_plugin_types(); do not call it yourself. */ extern void register_tap_plugin_type(void); +#endif /* * For all tap plugins, call their register routines.