Merge branch 'fix_defines_better' of https://github.com/swt2c/Phoenix into pr45-alternate

This commit is contained in:
Robin Dunn
2016-05-07 00:30:31 -07:00
3 changed files with 13 additions and 7 deletions

View File

@@ -1023,6 +1023,18 @@ def cmd_sip(options, args):
# ...or totally remove them by replacing those lines with ''
import re
srcTxt = re.sub(r'^#line.*\n', '', srcTxt, flags=re.MULTILINE)
# Perform a couple of manual modifications to the generated cpp
# to fix C++11 compilation errors.
if os.path.basename(src) == 'sip_corecmodule.cpp':
srcTxt = srcTxt.replace('wxCANCEL_DEFAULT},',
'static_cast<int>(wxCANCEL_DEFAULT)},')
srcTxt = srcTxt.replace('wxVSCROLL},',
'static_cast<int>(wxVSCROLL)},')
srcTxt = srcTxt.replace('wxWINDOW_STYLE_MASK},',
'static_cast<int>(wxWINDOW_STYLE_MASK)},')
if os.path.basename(src) == 'sip_stccmodule.cpp':
srcTxt = srcTxt.replace('wxSTC_MASK_FOLDERS},',
'static_cast<int>(wxSTC_MASK_FOLDERS)},')
return srcTxt
# Check each file in tmpdir to see if it is different than the same file

View File

@@ -123,9 +123,6 @@ def run():
return rv;
""")
# Correct the type for this define as its value is outside the range of int
module.find('wxSTC_MASK_FOLDERS').type = 'unsigned long'
# TODO: Add the UTF8 PyMethods from classic (see _stc_utf8_methods.py)

View File

@@ -44,13 +44,10 @@ def run():
module.find('wxUIntPtr').ignore()
# Correct the types for these as their values are outside the range of int
module.find('wxUINT32_MAX').type = 'long'
module.find('wxUINT32_MAX').type = 'unsigned long'
module.find('wxINT64_MIN').type = 'long long'
module.find('wxINT64_MAX').type = 'long long'
module.find('wxUINT64_MAX').type = 'unsigned long long'
module.find('wxCANCEL_DEFAULT').type = 'unsigned long'
module.find('wxWINDOW_STYLE_MASK').type = 'unsigned long'
module.find('wxVSCROLL').type = 'unsigned long'
module.find('wxInt8').pyInt = True
module.find('wxUint8').pyInt = True