]> sigrok.org Git - libsigrok.git/commitdiff
SWIG: Hack around SWIG segfault on private destructors
authorDaniel Elstner <redacted>
Sun, 11 Oct 2015 12:31:18 +0000 (14:31 +0200)
committerDaniel Elstner <redacted>
Mon, 26 Oct 2015 05:45:56 +0000 (06:45 +0100)
Apparently this problem has been fixed in SWIG 3.0.6. However,
until we can require that version, define "private" as "protected"
when running the SWIG parser.

Makefile.am
bindings/python/setup.py

index 582b38f7d47107689c7871add24440cf6d14801f..b05890b33378d5f682da02b44a1bb4f12ad12b98 100644 (file)
@@ -651,7 +651,8 @@ $(JCXX): $(srcdir)/$(JSWG) $(JDOC) bindings/swig/classes.i bindings/swig/enums.i
                $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
                $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
        -$(AM_V_at)rm -f $(java_cleanfiles)
-       $(AM_V_GEN)$(SWIG) -c++ -Dnoexcept= -java -package org.sigrok.core.classes \
+       $(AM_V_GEN)$(SWIG) -c++ -Dnoexcept= -Dprivate=protected \
+               -java -package org.sigrok.core.classes \
                -Ibindings -I$(JCLS) $(local_includes) -I$(srcdir) $(JNI_CPPFLAGS) \
                -outdir $(JCLS) -o $@ $(srcdir)/$(JSWG)
 
index c70fffca25634f11168bc5844cd39304b44b4dfc..e38acc7511c4290fc1b6f79c49eb26efc75e01b1 100644 (file)
@@ -87,8 +87,9 @@ setup(
     ext_modules = [
         Extension('sigrok.core._classes',
             sources = [vpath('sigrok/core/classes.i')],
-            swig_opts = ['-c++', '-threads', '-Dnoexcept=', '-Isigrok/core',
-                '-I..', '-I' + srcdir_parent] + ['-I%s' % i for i in includes],
+            swig_opts = ['-c++', '-threads', '-Dnoexcept=', '-Dprivate=protected',
+                '-Isigrok/core', '-I..', '-I' + srcdir_parent] +
+                ['-I%s' % i for i in includes],
             extra_compile_args = ['-Wno-uninitialized'],
             include_dirs = includes,
             library_dirs = libdirs,