From 2b1040ae67819958e13b6bf945d81b1ce33eda42 Mon Sep 17 00:00:00 2001 From: Ian McInerney <i.mcinerney17@imperial.ac.uk> Date: Tue, 14 Feb 2023 13:48:47 +0000 Subject: [PATCH] Fix compatibility with older wx versions ToInt was only added in wx 3.1.6 apparently, so for now make them long types. Fixes bug introduced in 8ce0a84ca7454c0a993317aea2cbeb2b8d331a26. --- scripting/python_scripting.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripting/python_scripting.cpp b/scripting/python_scripting.cpp index 624f3f0a7d..3dab01df39 100644 --- a/scripting/python_scripting.cpp +++ b/scripting/python_scripting.cpp @@ -129,10 +129,10 @@ except: wxVI.GetMajor(), wxVI.GetMinor(), wxVI.GetMicro() ); version = version.Mid( idx + 10 ); - int wxPy_major = 0; - int wxPy_minor = 0; - int wxPy_micro = 0; - int wxPy_rev = 0; + long wxPy_major = 0; + long wxPy_minor = 0; + long wxPy_micro = 0; + long wxPy_rev = 0; // Compile a regex to extract the wxPython version wxRegEx re( "([0-9]+)\\.([0-9]+)\\.?([0-9]+)?\\.?([0-9]+)?" ); @@ -143,22 +143,22 @@ except: wxString v = re.GetMatch( version, 1 ); if( !v.IsEmpty() ) - v.ToInt( &wxPy_major ); + v.ToLong( &wxPy_major ); v = re.GetMatch( version, 2 ); if( !v.IsEmpty() ) - v.ToInt( &wxPy_minor ); + v.ToLong( &wxPy_minor ); v = re.GetMatch( version, 3 ); if( !v.IsEmpty() ) - v.ToInt( &wxPy_micro ); + v.ToLong( &wxPy_micro ); v = re.GetMatch( version, 4 ); if( !v.IsEmpty() ) - v.ToInt( &wxPy_rev ); + v.ToLong( &wxPy_rev ); } if( ( wxVI.GetMajor() != wxPy_major ) || ( wxVI.GetMinor() != wxPy_minor ) )