hello,
with r8466:
the execution of this script causes an error on the "UnixFilename ()":
///-----------------------------------------------------------------------------
/// test_UnixFilename.script : LETARTARE 15-10-2012
///-----------------------------------------------------------------------------
function SetBuildOptions (base) {
}
///-----------------------------------------------------------------------------
function main() {
/// path file configuration
local Nameconf = _T("default.conf");
/// locate 'default.conf'
local pathconf = ::LocateDataFile(Nameconf, ::sdAllKnown);
/// results
::print (pathconf)
/// ===> Squirrel error from revision r8394 <===
::print (UnixFilename(pathconf))
}
///-----------------------------------------------------------------------------
/// Vista business Pack2 , Mingw32 with TDM-GCC 4.5.2, wxWidgets unicode 2.8.12
/// C::B ...r8393, r8394...r8466
///-----------------------------------------------------------------------------
///-----------------------------------------------------------------------------
/// with <= r8393 : it's good
/// C:\Users\aaa\AppData\Roaming\CodeBlocks\default.conf
/// C:\Users\aaa\AppData\Roaming\CodeBlocks\default.conf
///-----------------------------------------------------------------------------
/// with >= r8394 : Squirrel error
/// Message :
/// AN ERROR HAS OCCURED [Incorrect function argument]
/// CALLSTACK
/// *FUNCTION [main()] test_UnixFilename.script line [17]
/// *FUNCTION [main()] ScriptConsole line [1]
///-----------------------------------------------------------------------------
looking, I found that the error occurs since r8394.
I think MortenMacFly realized the r8394.
Can you help me?
cordially
hello,
thank you.
I tried with r8394, r8466 and I have no error.
-> Include\global.h is written:
r8393 :
extern DLLIMPORT wxString UnixFilename(const wxString& filename);
r8394 ... r8466:
extern DLLIMPORT wxString UnixFilename(const wxString& filename, wxPathFormat format = wxPATH_NATIVE);
of course must specify the defaults in Squirrel !!
But why the change from r8394 ?
Thank you again.
Maybe overload instead of default arguments then? ... except this does not compile because squirrel cannot figure out what to bind.
Index: src/include/globals.h
===================================================================
--- src/include/globals.h (revision 8478)
+++ src/include/globals.h (working copy)
@@ -186,7 +186,8 @@
extern DLLIMPORT wxString MakeUniqueString(const wxString& text, const wxString& separator = DEFAULT_ARRAY_SEP, bool caseSens = true);
extern DLLIMPORT void AppendArray(const wxArrayString& from, wxArrayString& to);
-extern DLLIMPORT wxString UnixFilename(const wxString& filename, wxPathFormat format = wxPATH_NATIVE);
+extern DLLIMPORT wxString UnixFilename(const wxString& filename/*, wxPathFormat format = wxPATH_NATIVE*/);
+extern DLLIMPORT wxString UnixFilename(const wxString& filename, wxPathFormat format/* = wxPATH_NATIVE*/);
extern DLLIMPORT void QuoteStringIfNeeded(wxString& str);
/// Escapes spaces and tabs (NOT quoting the string)
Index: src/sdk/globals.cpp
===================================================================
--- src/sdk/globals.cpp (revision 8478)
+++ src/sdk/globals.cpp (working copy)
@@ -211,6 +211,11 @@
to.Add(from[i]);
}
+wxString UnixFilename(const wxString& filename)
+{
+ return UnixFilename(filename, wxPATH_NATIVE);
+}
+
wxString UnixFilename(const wxString& filename, wxPathFormat format)
{
wxString result = filename;