On Fri, Nov 17, 2017 at 08:56:09PM -0600, Amit Kulkarni wrote:
> found a potential fix from FreeBSD
> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=175592&action=diff
> which was mentioned in
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197888
> 
> I will try to generate a patch in the following week.

Thank you, Amit!  

The FreeBSD patch removes the null references in wxPGProperty, which
I have tested on amd64.  This solves the problem.

I have backported to 6.2-stable, and am compiling to test, but as it
is the same revision of the application I expect no issues.

Both patch sets are attached.  

As noted in the FreeBSD bug report, this is a workaround for code
design. An upstream rewrite to use pointers rather than references
would be an improvement.

   -Josh-
Index: Makefile
===================================================================
RCS file: /systems/cvs/ports/devel/codeblocks/Makefile,v
retrieving revision 1.43
diff -u -p -r1.43 Makefile
--- Makefile    16 Nov 2017 23:20:37 -0000      1.43
+++ Makefile    19 Nov 2017 13:47:37 -0000
@@ -7,7 +7,7 @@ COMMENT=        Code::Blocks C/C++ IDE
 V=             16.01
 DISTNAME=      codeblocks_${V}
 PKGNAME=       codeblocks-${V}
-REVISION=      3
+REVISION=      4
 
 WRKDIST=       ${WRKDIR}/codeblocks-${V}.release
 
Index: patches/patch-src_sdk_wxpropgrid_include_wx_propgrid_propgrid_h
===================================================================
RCS file: patches/patch-src_sdk_wxpropgrid_include_wx_propgrid_propgrid_h
diff -N patches/patch-src_sdk_wxpropgrid_include_wx_propgrid_propgrid_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_sdk_wxpropgrid_include_wx_propgrid_propgrid_h     19 Nov 
2017 14:51:27 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+Remove null references in wxPGProperty
+from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197888
+
+Index: src/sdk/wxpropgrid/include/wx/propgrid/propgrid.h
+--- src/sdk/wxpropgrid/include/wx/propgrid/propgrid.h.orig
++++ src/sdk/wxpropgrid/include/wx/propgrid/propgrid.h
+@@ -700,7 +700,7 @@ class WXDLLIMPEXP_PG wxPGCell (protected)
+ #define wxPG_EMPTY_ARRAYSTRING  wxArrayString()
+ 
+ #if !defined(SWIG)
+-    #define wxPG_LABEL              (*((wxString*)NULL))  // Used to tell 
wxPGProperty to use label as name as well.
++    extern WXDLLIMPEXP_PG const wxString wxPG_LABEL; // Used to tell 
wxPGProperty to use label as name as well.
+     #define wxPG_NULL_BITMAP        wxNullBitmap
+     #define wxPG_COLOUR_BLACK       (*wxBLACK)
+ #else
Index: patches/patch-src_sdk_wxpropgrid_src_propgrid_cpp
===================================================================
RCS file: patches/patch-src_sdk_wxpropgrid_src_propgrid_cpp
diff -N patches/patch-src_sdk_wxpropgrid_src_propgrid_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_sdk_wxpropgrid_src_propgrid_cpp   19 Nov 2017 14:51:42 
-0000
@@ -0,0 +1,34 @@
+$OpenBSD$
+
+Remove null references in wxPGProperty
+from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197888
+
+Index: src/sdk/wxpropgrid/src/propgrid.cpp
+--- src/sdk/wxpropgrid/src/propgrid.cpp.orig
++++ src/sdk/wxpropgrid/src/propgrid.cpp
+@@ -333,6 +333,8 @@ const wxChar *wxPGTypeName_PyObject = wxT("PyObject");
+ 
+ static const wxChar* gs_noCellText = wxT("@!");
+ 
++const wxString wxPG_LABEL;
++
+ // -----------------------------------------------------------------------
+ 
+ static void wxPGDrawFocusRect( wxDC& dc, const wxRect& rect )
+@@ -679,13 +681,13 @@ void wxPGProperty::Init()
+ 
+ void wxPGProperty::Init( const wxString& label, const wxString& name )
+ {
+-    if ( &label != ((wxString*)NULL) )
++    if ( label != wxPG_LABEL )
+         m_label = label;
+ 
+ #ifndef __WXPYTHON__
+-    if ( &name != ((wxString*)NULL) )
++    if ( label != wxPG_LABEL )
+ #else
+-    if ( (&name != ((wxString*)NULL)) && name != wxT("_LABEL_AS_NAME") )
++    if ( name != wxPG_LABEL && name != wxT("_LABEL_AS_NAME") )
+ #endif
+         DoSetName( name );
+     else
? codeblocks.stable.patch
Index: Makefile
===================================================================
RCS file: /systems/cvs/ports/devel/codeblocks/Makefile,v
retrieving revision 1.41
diff -u -p -r1.41 Makefile
--- Makefile    26 Jul 2017 22:45:17 -0000      1.41
+++ Makefile    19 Nov 2017 14:52:38 -0000
@@ -7,7 +7,7 @@ COMMENT=        Code::Blocks C/C++ IDE
 V=             16.01
 DISTNAME=      codeblocks_${V}
 PKGNAME=       codeblocks-${V}
-REVISION=      2
+REVISION=      3
 
 WRKDIST=       ${WRKDIR}/codeblocks-${V}.release
 
Index: patches/patch-src_sdk_wxpropgrid_include_wx_propgrid_propgrid_h
===================================================================
RCS file: patches/patch-src_sdk_wxpropgrid_include_wx_propgrid_propgrid_h
diff -N patches/patch-src_sdk_wxpropgrid_include_wx_propgrid_propgrid_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_sdk_wxpropgrid_include_wx_propgrid_propgrid_h     19 Nov 
2017 14:52:38 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+Remove null references in wxPGProperty 
+from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197888
+
+Index: src/sdk/wxpropgrid/include/wx/propgrid/propgrid.h
+--- src/sdk/wxpropgrid/include/wx/propgrid/propgrid.h.orig
++++ src/sdk/wxpropgrid/include/wx/propgrid/propgrid.h
+@@ -700,7 +700,7 @@ class WXDLLIMPEXP_PG wxPGCell (protected)
+ #define wxPG_EMPTY_ARRAYSTRING  wxArrayString()
+ 
+ #if !defined(SWIG)
+-    #define wxPG_LABEL              (*((wxString*)NULL))  // Used to tell 
wxPGProperty to use label as name as well.
++    extern WXDLLIMPEXP_PG const wxString wxPG_LABEL; // Used to tell 
wxPGProperty to use label as name as well.
+     #define wxPG_NULL_BITMAP        wxNullBitmap
+     #define wxPG_COLOUR_BLACK       (*wxBLACK)
+ #else
Index: patches/patch-src_sdk_wxpropgrid_src_propgrid_cpp
===================================================================
RCS file: patches/patch-src_sdk_wxpropgrid_src_propgrid_cpp
diff -N patches/patch-src_sdk_wxpropgrid_src_propgrid_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_sdk_wxpropgrid_src_propgrid_cpp   19 Nov 2017 14:52:38 
-0000
@@ -0,0 +1,34 @@
+$OpenBSD$
+
+Remove null references in wxPGProperty
+from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197888
+
+Index: src/sdk/wxpropgrid/src/propgrid.cpp
+--- src/sdk/wxpropgrid/src/propgrid.cpp.orig
++++ src/sdk/wxpropgrid/src/propgrid.cpp
+@@ -333,6 +333,8 @@ const wxChar *wxPGTypeName_PyObject = wxT("PyObject");
+ 
+ static const wxChar* gs_noCellText = wxT("@!");
+ 
++const wxString wxPG_LABEL;
++
+ // -----------------------------------------------------------------------
+ 
+ static void wxPGDrawFocusRect( wxDC& dc, const wxRect& rect )
+@@ -679,13 +681,13 @@ void wxPGProperty::Init()
+ 
+ void wxPGProperty::Init( const wxString& label, const wxString& name )
+ {
+-    if ( &label != ((wxString*)NULL) )
++    if ( label != wxPG_LABEL )
+         m_label = label;
+ 
+ #ifndef __WXPYTHON__
+-    if ( &name != ((wxString*)NULL) )
++    if ( label != wxPG_LABEL )
+ #else
+-    if ( (&name != ((wxString*)NULL)) && name != wxT("_LABEL_AS_NAME") )
++    if ( name != wxPG_LABEL && name != wxT("_LABEL_AS_NAME") )
+ #endif
+         DoSetName( name );
+     else

Reply via email to