From 49f6a63a06fb698f34b3386d2686008b51ed2839 Mon Sep 17 00:00:00 2001 From: Ian McInerney 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 1e8cc6855d6a8fc1f9dfc933224c3a10fb759f9c (Cherry-picked from 2b1040ae67819958e13b6bf945d81b1ce33eda42) --- 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 ) )