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 1e8cc6855d

(Cherry-picked from 2b1040ae67)
This commit is contained in:
Ian McInerney 2023-02-14 13:48:47 +00:00
parent e078fea846
commit 49f6a63a06
1 changed files with 8 additions and 8 deletions

View File

@ -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 ) )