From: John L. <jr...@us...> - 2008-03-26 05:01:40
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28499/wxLua/modules/wxlua/include Modified Files: wxlstate.h Log Message: Fix ungcobject() in Lua, compilation fix. Switch to using wxConvCurrent for lua2wx and wx2lua ifdefed using WXLUA_USE_WXSTR_CONVCURRENT Allow Continue to work in the wxLuaDebugTarget (thanks to andre arpin) Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** wxlstate.h 29 Jan 2008 00:49:15 -0000 1.120 --- wxlstate.h 26 Mar 2008 05:01:33 -0000 1.121 *************** *** 28,36 **** --- 28,43 ---- // ---------------------------------------------------------------------------- + #define WXLUA_USE_WXSTR_CONVCURRENT 1 + // Convert a 8-bit ANSI C Lua String into a wxString inline WXDLLIMPEXP_WXLUA wxString lua2wx(const char* luastr) { + #if WXLUA_USE_WXSTR_CONVCURRENT + if (luastr == NULL) return wxEmptyString; // check for NULL + return wxString(luastr, *wxConvCurrent); + + #else //!WXLUA_USE_WXSTR_CONVCURRENT #if wxUSE_UNICODE wxString str(luastr, wxConvUTF8); *************** *** 43,46 **** --- 50,54 ---- return str; + #endif //WXLUA_USE_WXSTR_CONVCURRENT } *************** *** 48,51 **** --- 56,64 ---- inline const WXDLLIMPEXP_WXLUA wxCharBuffer wx2lua(const wxString& wxstr) { + #if WXLUA_USE_WXSTR_CONVCURRENT + wxCharBuffer buffer(wxstr.mb_str(*wxConvCurrent)); + return buffer; + + #else //!WXLUA_USE_WXSTR_CONVCURRENT wxCharBuffer buffer(wxConvUTF8.cWC2MB(wxstr.wc_str(*wxConvCurrent))); // skieu *************** *** 54,59 **** --- 67,74 ---- return buffer; + #endif //WXLUA_USE_WXSTR_CONVCURRENT } + // Convert a wxString to 8-bit ANSI C Lua Buffer and store it class WXDLLIMPEXP_WXLUA wxLuaCharBuffer |