diff --git a/code/nel/include/nel/misc/string_common.h b/code/nel/include/nel/misc/string_common.h index 4ce793670..bb972a4eb 100644 --- a/code/nel/include/nel/misc/string_common.h +++ b/code/nel/include/nel/misc/string_common.h @@ -357,9 +357,6 @@ inline tstring mbcsToTStr(const std::string &str) { return (const tstring &)str; #define nlMbcsToTStr(str) ((const tchar *)NLMISC::asCStr(str)) #endif -inline const tchar *asCStr(const tchar *str) { return str; } -inline const tchar *asCStr(const tstring &str) { return str.c_str(); } - } // NLMISC #endif // NL_STRING_COMMON_H diff --git a/code/nel/include/nel/net/service.h b/code/nel/include/nel/net/service.h index 8b79bdc55..5d99477ff 100644 --- a/code/nel/include/nel/net/service.h +++ b/code/nel/include/nel/net/service.h @@ -146,7 +146,7 @@ int nltmain(int argc, const NLMISC::tchar **argv) \ { \ NLMISC::CApplicationContext serviceContext; \ __ServiceClassName *scn = new __ServiceClassName; \ - scn->setArgs (argc, nlTStrToUtf8(argv)); \ + scn->setArgs (argc, argv); \ createDebug(NULL,!scn->haveLongArg("nolog"));\ scn->setCallbackArray (__ServiceCallbackArray, sizeof(__ServiceCallbackArray)/sizeof(__ServiceCallbackArray[0])); \ sint retval = scn->main (__ServiceShortName, __ServiceLongName, __ServicePort, __ConfigDir, __LogDir, __DATE__ " " __TIME__); \ @@ -350,6 +350,9 @@ public: /// Sets the command line and init _Args variable. You must call this before calling main() void setArgs (int argc, const char **argv); + /// Sets the command line and init _Args variable. You must call this before calling main() + void setArgs (int argc, const wchar_t **argv); + /// Sets the command line and init _Args variable. You must call this before calling main() void setArgs (const char *args); diff --git a/code/nel/src/net/service.cpp b/code/nel/src/net/service.cpp index 24064db55..b0242bb86 100644 --- a/code/nel/src/net/service.cpp +++ b/code/nel/src/net/service.cpp @@ -492,6 +492,13 @@ void IService::setArgs (int argc, const char **argv) } } +void IService::setArgs(int argc, const wchar_t **argv) +{ + for (sint i = 0; i < argc; i++) + { + _Args.push_back(nlWideToUtf8(argv[i])); + } +} void cbLogFilter (CConfigFile::CVar &var) {