Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Mar 2019 21:00:40 +0000 (UTC)
From:      Christoph Moench-Tegeder <cmt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r495200 - in head/x11-toolkits/wxgtk30: . files
Message-ID:  <201903092100.x29L0eRg087640@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cmt
Date: Sat Mar  9 21:00:40 2019
New Revision: 495200
URL: https://svnweb.freebsd.org/changeset/ports/495200

Log:
  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.

Added:
  head/x11-toolkits/wxgtk30/files/patch-src_unix_fswatcher__kqueue.cpp   (contents, props changed)
Modified:
  head/x11-toolkits/wxgtk30/Makefile

Modified: head/x11-toolkits/wxgtk30/Makefile
==============================================================================
--- head/x11-toolkits/wxgtk30/Makefile	Sat Mar  9 20:37:00 2019	(r495199)
+++ head/x11-toolkits/wxgtk30/Makefile	Sat Mar  9 21:00:40 2019	(r495200)
@@ -3,7 +3,7 @@
 PORTNAME=	wx
 PORTVERSION=	3.0.4
 DISTVERSIONPREFIX=	v
-PORTREVISION=	6
+PORTREVISION=	7
 CATEGORIES=	x11-toolkits
 PKGNAMESUFFIX=	30-gtk3
 

Added: head/x11-toolkits/wxgtk30/files/patch-src_unix_fswatcher__kqueue.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11-toolkits/wxgtk30/files/patch-src_unix_fswatcher__kqueue.cpp	Sat Mar  9 21:00:40 2019	(r495200)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903092100.x29L0eRg087640>