diff --git a/buildmod.bash b/buildmod.bash index 55d1822..7a7f5f8 100755 --- a/buildmod.bash +++ b/buildmod.bash @@ -19,5 +19,5 @@ mkdir -p $SHAREDLIBS_DIR swig -c++ -c -cpperraswarn -nocxx -o "${WRAPPER_DIR}/${MOD_NAME}_wrap.cxx" $WX_CONFIG $(wx-config --cxxflags all) $MOD_PATH -clang++ -c "${WRAPPER_DIR}/${MOD_NAME}_wrap.cxx" -o "${OBJECTS_DIR}/${MOD_NAME}_wrap.o" -I$TEMPLATE_DIR -I. $WX_CONFIG $(wx-config --cxxflags all) -clang++ -shared -o "${SHAREDLIBS_DIR}/lib${MOD_NAME}.so" "${OBJECTS_DIR}/${MOD_NAME}_wrap.o" $(wx-config --libs all) +clang++ -O2 -c "${WRAPPER_DIR}/${MOD_NAME}_wrap.cxx" -o "${OBJECTS_DIR}/${MOD_NAME}_wrap.o" -I$TEMPLATE_DIR -I. $WX_CONFIG $(wx-config --cxxflags all) +clang++ -O2 -shared -o "${SHAREDLIBS_DIR}/lib${MOD_NAME}.so" "${OBJECTS_DIR}/${MOD_NAME}_wrap.o" $(wx-config --libs all) diff --git a/swigtemplates/buffer.i b/swigtemplates/buffer.i index 0e3715c..b545383 100644 --- a/swigtemplates/buffer.i +++ b/swigtemplates/buffer.i @@ -1,53 +1,10 @@ %module buffer -%include -%include +%include %{ #include +#include %} -%define __arm64__ 1 -%enddef -%define TARGET_CPU_ARM64 1 -%enddef -%define __APPLE__ 1 -%enddef -%define __LP64__ 1 -%enddef -%define __MACH__ 1 -%enddef - -#define __FUNCTION__ (NULL) -#define __asm(str) -#define __attribute__(str) - -/* #define WXEXPORT */ -/* #define WXIMPORT */ -%ignore WX_DECLARE_LIST_XO; -%ignore WX_DECLARE_LIST_2(elementtype, listname, nodename, classexp); -%ignore WX_DECLARE_LIST_3; -%ignore WX_DECLARE_LIST_4; -%ignore WXDLLIMPEXP_BASE; -%ignore _WX_LIST_HELPER_wxWindowList; -%ignore _WX_LIST_HELPER_wxPointList; -%ignore wxWindowList::Nth; -%ignore wxPointList::Nth; -%ignore wxPendingDelete; -%ignore wxCreateApp; -%ignore wxTheAppInitializer; - -%extend wxCharBuffer { - wxCharBuffer(const char *str = NULL) { - return new wxCharBuffer(str); - } -} -%extend wxWCharBuffer { - wxWCharBuffer(const wchar_t *str = NULL) { - return new wxWCharBuffer(str); - } -} - -%ignore wxCharBuffer::wxCharBuffer(const CharType * str); -%ignore wxWCharBuffer::wxWCharBuffer(const CharType * str); %import "wx/setup.h" #undef HAVE_VISIBILITY diff --git a/swigtemplates/string.i b/swigtemplates/string.i index 9f188e4..e32ea03 100644 --- a/swigtemplates/string.i +++ b/swigtemplates/string.i @@ -2,6 +2,7 @@ %include %import "object.i" +%import "buffer.i" %import "wx/setup.h" #undef HAVE_VISIBILITY @@ -19,4 +20,3 @@ %import "wx/strconv.h" %import "wx/strvararg.h" %include "wx/string.h" - diff --git a/wxheaders/wx/buffer.h b/wxheaders/wx/buffer.h index 9d24f53..a1bcf8f 100644 --- a/wxheaders/wx/buffer.h +++ b/wxheaders/wx/buffer.h @@ -311,7 +311,7 @@ public: wxCharTypeBuffer& operator=(const wxScopedCharTypeBuffer& src) { - MakeOwnedCopyOf(src); + this->MakeOwnedCopyOf(src); return *this; } @@ -365,7 +365,7 @@ public: wxCharBuffer(const wxScopedCharTypeBufferBase& buf) : wxCharTypeBufferBase(buf) {} - wxCharBuffer(const CharType *str = NULL) : wxCharTypeBufferBase(str) {} + wxCharBuffer(const wxCharBuffer::CharType *str = NULL) : wxCharTypeBufferBase(str) {} wxCharBuffer(size_t len) : wxCharTypeBufferBase(len) {} wxCharBuffer(const wxCStrData& cstr); @@ -382,7 +382,7 @@ public: wxWCharBuffer(const wxScopedCharTypeBufferBase& buf) : wxCharTypeBufferBase(buf) {} - wxWCharBuffer(const CharType *str = NULL) : wxCharTypeBufferBase(str) {} + wxWCharBuffer(const wxWCharBuffer::CharType *str = NULL) : wxCharTypeBufferBase(str) {} wxWCharBuffer(size_t len) : wxCharTypeBufferBase(len) {} wxWCharBuffer(const wxCStrData& cstr);