diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2018-08-21 15:18:56 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2018-08-21 19:56:12 +0000 |
commit | 65d9c473f035290b1b076268332c399125f048ca (patch) | |
tree | e6d4236dd6436e38ad7f6a586fecc7d563200426 /doc/plugins.example | |
parent | 0410a522d5b5e0b7c534146628770f9801e314e2 (diff) |
plugins: Minor interface improvement
Change the plugin compatibility check to make it more convenient to
define and check the major.minor Wireshark version.
Change-Id: I2a6d2a746682c29504311cce5c457e0a852c3daf
Reviewed-on: https://code.wireshark.org/review/29224
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'doc/plugins.example')
-rw-r--r-- | doc/plugins.example/CMakeLists.txt | 3 | ||||
-rw-r--r-- | doc/plugins.example/hello.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/doc/plugins.example/CMakeLists.txt b/doc/plugins.example/CMakeLists.txt index e7a20219e7..d754fc4cf3 100644 --- a/doc/plugins.example/CMakeLists.txt +++ b/doc/plugins.example/CMakeLists.txt @@ -20,7 +20,6 @@ pkg_check_modules(WIRESHARK REQUIRED wireshark>=2.5) ### CMake Bug: If you run into problems please use the "Unix Makefiles" generator. ### Ninja just wipes the pkg-config variables. # https://gitlab.kitware.com/cmake/cmake/issues/17531 (and probably others) -pkg_get_variable(WIRESHARK_VERSION_RELEASE wireshark VERSION_RELEASE) pkg_get_variable(WIRESHARK_PLUGIN_DIR wireshark plugindir) set(PLUGIN_INSTALL_LIBDIR "${WIRESHARK_PLUGIN_DIR}/epan") @@ -41,7 +40,7 @@ if (CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}") endif() -add_definitions(-DHAVE_PLUGINS -DVERSION=\"${PROJECT_VERSION}\" -DVERSION_RELEASE=\"${WIRESHARK_VERSION_RELEASE}\") +add_definitions(-DHAVE_PLUGINS -DVERSION=\"${PROJECT_VERSION}\") add_library(hello MODULE hello.c) set_target_properties(hello PROPERTIES PREFIX "" DEFINE_SYMBOL "") diff --git a/doc/plugins.example/hello.c b/doc/plugins.example/hello.c index 52c4a50ec6..4e128afeda 100644 --- a/doc/plugins.example/hello.c +++ b/doc/plugins.example/hello.c @@ -14,6 +14,7 @@ #include <epan/packet.h> #include <epan/proto.h> #include <ws_attributes.h> +#include <ws_version.h> #ifndef VERSION #define VERSION "0.0.0" @@ -22,7 +23,8 @@ #define DLL_PUBLIC __attribute__((__visibility__("default"))) DLL_PUBLIC const gchar plugin_version[] = VERSION; -DLL_PUBLIC const gchar plugin_release[] = VERSION_RELEASE; +DLL_PUBLIC const int plugin_want_major = WIRESHARK_VERSION_MAJOR; +DLL_PUBLIC const int plugin_want_minor = WIRESHARK_VERSION_MINOR; DLL_PUBLIC void plugin_register(void); |