[aseprite] 162/308: Fix argc/argv parameters for app_main() in Skia/Win port

Tobias Hansen thansen at moszumanska.debian.org
Tue Mar 8 02:45:06 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 49ad91dd790996a453ed163d95010dd7fd392356
Author: David Capello <davidcapello at gmail.com>
Date:   Mon Dec 28 15:34:00 2015 -0300

    Fix argc/argv parameters for app_main() in Skia/Win port
---
 src/she/skia/she.cpp | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/she/skia/she.cpp b/src/she/skia/she.cpp
index e3c4af7..9482dab 100644
--- a/src/she/skia/she.cpp
+++ b/src/she/skia/she.cpp
@@ -8,6 +8,7 @@
 #include "config.h"
 #endif
 
+#include "base/memory.h"
 #include "gfx/rect.h"
 #include "gfx/size.h"
 #include "she/she.h"
@@ -66,10 +67,21 @@ extern int app_main(int argc, char* argv[]);
 
 #if _WIN32
 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
-  LPSTR lpCmdLine, int nCmdShow)
+                   LPSTR lpCmdLine, int nCmdShow)
 {
-  int argc = 1;
-  char* argv[] = { "" };
+  int argc = 0;
+  LPWSTR* argvW = CommandLineToArgvW(GetCommandLineW(), &argc);
+  char** argv;
+  if (argvW && argc > 0) {
+    argv = new char*[argc];
+    for (int i=0; i<argc; ++i)
+      argv[i] = base_strdup(base::to_utf8(std::wstring(argvW[i])).c_str());
+    LocalFree(argvW);
+  }
+  else {
+    argv = new char*[1];
+    argv[0] = base_strdup("");
+  }
 #else
 int main(int argc, char* argv[])
 {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list