From 0fc5f016c17dcc728d2880c7282b43681f8194f2 Mon Sep 17 00:00:00 2001 From: Natashi <32347635+Natashi@users.noreply.github.com> Date: Mon, 3 Aug 2020 16:01:33 +0700 Subject: [PATCH] Varargs for WriteLog --- source/GcLib/gstd/ScriptClient.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/GcLib/gstd/ScriptClient.cpp b/source/GcLib/gstd/ScriptClient.cpp index 9092e862..348ef8fe 100644 --- a/source/GcLib/gstd/ScriptClient.cpp +++ b/source/GcLib/gstd/ScriptClient.cpp @@ -140,7 +140,7 @@ function const commonFunction[] = { "GetCurrentDateTimeS", ScriptClientBase::Func_GetCurrentDateTimeS, 0 }, //共通関数:デバッグ関連 - { "WriteLog", ScriptClientBase::Func_WriteLog, 1 }, + { "WriteLog", ScriptClientBase::Func_WriteLog, -2 }, //0 fixed + ... -> 1 minimum { "RaiseError", ScriptClientBase::Func_RaiseError, 1 }, //共通関数:共通データ @@ -1455,7 +1455,12 @@ value ScriptClientBase::Func_GetCurrentDateTimeS(script_machine* machine, int ar //共通関数:デバッグ関連 value ScriptClientBase::Func_WriteLog(script_machine* machine, int argc, const value* argv) { - std::wstring msg = argv->as_string(); + std::wstring msg = L""; + for (int i = 0; i < argc; ) { + msg += argv[i].as_string(); + if ((++i) >= argc) break; + msg += L","; + } Logger::WriteTop(msg); return value(); }