From a89a4d9e844935c53f07e1ebeea5fbd636e4b263 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Tue, 19 May 2015 15:48:25 +1200 Subject: [PATCH] [Python] Fix warning when compiling generated code with MSVC. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://sourceforge.net/p/swig/patches/351/ reported by Mateusz Szymański). --- CHANGES.current | 5 +++++ Lib/python/pyinit.swg | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.current b/CHANGES.current index 06fee5658..8dadc3662 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,11 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.6 (in progress) =========================== +2015-05-19: olly + [Python] Fix warning when compiling generated code with MSVC. + (Fixes https://sourceforge.net/p/swig/patches/351/ reported by + Mateusz Szymański). + 2015-05-14: wsfulton Fix seg fault wrapping shared_ptr of classes with private constructors and destructors. This also fixes the "unref" feature when used on classes with private destructors. diff --git a/Lib/python/pyinit.swg b/Lib/python/pyinit.swg index 47d3d9700..e71c72b27 100644 --- a/Lib/python/pyinit.swg +++ b/Lib/python/pyinit.swg @@ -275,7 +275,9 @@ SWIG_Python_FixMethods(PyMethodDef *methods, size_t i; for (i = 0; methods[i].ml_name; ++i) { const char *c = methods[i].ml_doc; - if (c && (c = strstr(c, "swig_ptr: "))) { + if (!c) continue; + c = strstr(c, "swig_ptr: "); + if (c) { int j; swig_const_info *ci = 0; const char *name = c + 10;