aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2021-12-20 02:33:15 +0000
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-12-21 01:30:06 +0000
commit4448b6494e0f6bece719160e652fb872be32eb21 (patch)
treede9c76bc675e57391e72370ff5479fa08590c9c6 /doc
parent36d5aad962f6c481a4aed09a0a8f7a575fcbdd12 (diff)
Add a ws_posix_compat.h header
Currently used to define ssize_t on platforms that lack it. Fix some Windows build errors caused by moving the definition into a separate header. Fix some narrowing warnings on Windows x64 from changing the definition of ssize_t from long int to int64_t. The casts in dumpcap are ugly but necessary. The whole code needs to be rewritten for portability, or the warnings disabled.
Diffstat (limited to 'doc')
-rw-r--r--doc/plugins.example/CMakeLists.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/doc/plugins.example/CMakeLists.txt b/doc/plugins.example/CMakeLists.txt
index 41242dbe52..223abd6662 100644
--- a/doc/plugins.example/CMakeLists.txt
+++ b/doc/plugins.example/CMakeLists.txt
@@ -7,7 +7,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.12)
cmake_policy(SET CMP0048 NEW)
project(Hello VERSION 0.0.1 DESCRIPTION "Wireshark Hello Plugin" LANGUAGES C)
@@ -18,12 +18,18 @@ if(NOT Wireshark_PLUGINS_ENABLED)
message(WARNING "Wireshark was compiled without support for plugins")
endif()
+include(CheckTypeSize)
+check_type_size("ssize_t" SSIZE_T)
+
set(CMAKE_C_VISIBILITY_PRESET hidden)
if (CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}")
endif()
-add_definitions(-DVERSION=\"${PROJECT_VERSION}\")
+add_compile_definitions(
+ VERSION=\"${PROJECT_VERSION}\"
+ $<$<BOOL:${HAVE_SSIZE_T}>:HAVE_SSIZE_T>
+)
add_library(hello MODULE hello.c)
set_target_properties(hello PROPERTIES PREFIX "" DEFINE_SYMBOL "")