depends: Fix "unused variables" warning when compiling zeromq for Windows

Clang triggers that warning, which becomes an error due to -Werror.
This commit is contained in:
Jack Grigg 2020-10-13 13:55:44 +01:00
parent 2ca72adf8b
commit 3973a16358
2 changed files with 22 additions and 0 deletions

View File

@ -3,6 +3,7 @@ $(package)_version=4.3.3
$(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=9d9285db37ae942ed0780c016da87060497877af45094ff9e1a1ca736e3875a2
$(package)_patches=windows-unused-variables.diff
ifneq ($(host_os),darwin)
$(package)_dependencies=libcxx
@ -19,6 +20,10 @@ define $(package)_set_vars
$(package)_ldflags+=-static-libstdc++ -lc++abi
endef
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/windows-unused-variables.diff
endef
define $(package)_config_cmds
$($(package)_autoconf)
endef

View File

@ -0,0 +1,17 @@
diff -ur zeromq-4.3.3-orig/src/clock.cpp zeromq-4.3.3/src/clock.cpp
--- zeromq-4.3.3-orig/src/clock.cpp 2020-10-13 13:44:04.190000000 +0100
+++ zeromq-4.3.3/src/clock.cpp 2020-10-13 13:47:04.170000000 +0100
@@ -126,9 +126,13 @@
init_compatible_get_tick_count64 ();
#endif
+#ifndef ZMQ_HAVE_WINDOWS
const uint64_t usecs_per_msec = 1000;
+#endif
const uint64_t usecs_per_sec = 1000000;
+#ifndef ZMQ_HAVE_WINDOWS
const uint64_t nsecs_per_usec = 1000;
+#endif
zmq::clock_t::clock_t () :
_last_tsc (rdtsc ()),