aboutsummaryrefslogtreecommitdiff
path: root/x11-toolkits/wxgtk30
diff options
context:
space:
mode:
authorChristoph Moench-Tegeder <cmt@FreeBSD.org>2019-03-09 21:00:40 +0000
committerChristoph Moench-Tegeder <cmt@FreeBSD.org>2019-03-09 21:00:40 +0000
commit4f0e6046ce402b3dca863e5d0afda5bed9c4d701 (patch)
tree21fe99471a0a1f6af7e8ddea4d86ce9f1770dbfe /x11-toolkits/wxgtk30
parent698ee5b4d0a7b59650a52f192f0974a0193c3e00 (diff)
downloadports-4f0e6046ce402b3dca863e5d0afda5bed9c4d701.tar.gz
ports-4f0e6046ce402b3dca863e5d0afda5bed9c4d701.zip
wxgtk30: fix format strings for printing kevent data
WxWidgets can watch for filesystem changes via kevent(2). To aid debugging, incoming events are passed to a logging function (log level TRACE, which will be discarded unless explicitely enabled). The format strings used here did not match FreeBSD's struct kevent, and this mismatch triggered an assertion inside wx. (The assertion message was ./include/wx/strvararg.h(456): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type for your search engine's reference). (Observed e.g. in cad/kicad when (auto-)saving a project, where the assertion failure was passed as an error dialog to the GUI - having this pop up when saving your work does not instill confidence). This patch uses the format specifiers from inttypes.h and accounts for the changes to struct kevent between FreeBSD 11 and 12. NB: wxgtk31 has similar code in the same place, with some improvements, but IMO the fix is incomplete (it doesn't account for 11 vs 12). Maintainer will be notified.
Notes
Notes: svn path=/head/; revision=495200
Diffstat (limited to 'x11-toolkits/wxgtk30')
-rw-r--r--x11-toolkits/wxgtk30/Makefile2
-rw-r--r--x11-toolkits/wxgtk30/files/patch-src_unix_fswatcher__kqueue.cpp28
2 files changed, 29 insertions, 1 deletions
diff --git a/x11-toolkits/wxgtk30/Makefile b/x11-toolkits/wxgtk30/Makefile
index 8ccf7b12dca6..8ec4ba395170 100644
--- a/x11-toolkits/wxgtk30/Makefile
+++ b/x11-toolkits/wxgtk30/Makefile
@@ -3,7 +3,7 @@
PORTNAME= wx
PORTVERSION= 3.0.4
DISTVERSIONPREFIX= v
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= x11-toolkits
PKGNAMESUFFIX= 30-gtk3
diff --git a/x11-toolkits/wxgtk30/files/patch-src_unix_fswatcher__kqueue.cpp b/x11-toolkits/wxgtk30/files/patch-src_unix_fswatcher__kqueue.cpp
new file mode 100644
index 000000000000..1504efd2b12e
--- /dev/null
+++ b/x11-toolkits/wxgtk30/files/patch-src_unix_fswatcher__kqueue.cpp
@@ -0,0 +1,28 @@
+--- src/unix/fswatcher_kqueue.cpp.orig 2018-03-07 17:21:58 UTC
++++ src/unix/fswatcher_kqueue.cpp
+@@ -20,8 +20,10 @@
+
+ #ifdef wxHAS_KQUEUE
+
++#include <inttypes.h>
+ #include <sys/types.h>
+ #include <sys/event.h>
++#include <sys/param.h>
+
+ #include "wx/dynarray.h"
+ #include "wx/evtloop.h"
+@@ -279,8 +281,12 @@ class wxFSWatcherImplKqueue : public wxFSWatcherImpl (
+ {
+ wxASSERT_MSG(e.udata, "Null user data associated with kevent!");
+
+- wxLogTrace(wxTRACE_FSWATCHER, "Event: ident=%d, filter=%d, flags=%u, "
+- "fflags=%u, data=%d, user_data=%p",
++ wxLogTrace(wxTRACE_FSWATCHER, "Event: ident=%" PRIuPTR ", filter=%hd, flags=%hu, "
++#if __FreeBSD_version >= 1200033
++ "fflags=%u, data=%" PRId64 ", user_data=%p",
++#else
++ "fflags=%u, data=%" PRIdPTR ", user_data=%p",
++#endif
+ e.ident, e.filter, e.flags, e.fflags, e.data, e.udata);
+
+ // for ease of use