diff options
author | 2017-09-18 20:28:53 -0400 | |
---|---|---|
committer | 2017-09-18 20:28:53 -0400 | |
commit | 3d553eda60e1c5657b195154d2d6623e3c50ba70 (patch) | |
tree | 9f42e91558c87f4897d349bf85243a07d46ce5f2 /scripts/src | |
parent | a7d79f96457f769deb43c36638293604f36320f0 (diff) |
Attempted to sanitize/rationalize how we access UTF-8 command line arguments (#2532)
Specifically, this creates a call osd_get_command_line() that returns UTF-8 command line arguments as std::vector<std::string>. On non-Windows platforms, this does nothing more than build the vector. On Windows, this invokes GetCommandLineW() and CommandLineToArgvW(). This also attempts to unwind usage of wmain()/_tmain() on Windows, which is not standard.
Related to this, this fixes a bug in Imgtool; specifically, non-7 bit ASCII was not being handled correctly in Windows.
This is really an admission that the way that Windows handles Unicode and command line arguments sucks, and it is my belief that having a wmain() or _tmain() declaration specific for Windows is a worse solution. C'est la vie.
I'm very open to the idea that src/osd/osdcore.[cpp|h] is not the best place to do this. Let me know if I should move it.
Diffstat (limited to 'scripts/src')
-rw-r--r-- | scripts/src/main.lua | 5 | ||||
-rw-r--r-- | scripts/src/osd/sdl.lua | 8 | ||||
-rw-r--r-- | scripts/src/osd/sdl_cfg.lua | 1 | ||||
-rw-r--r-- | scripts/src/osd/windows.lua | 3 | ||||
-rw-r--r-- | scripts/src/osd/windows_cfg.lua | 3 |
5 files changed, 1 insertions, 19 deletions
diff --git a/scripts/src/main.lua b/scripts/src/main.lua index ebad23b0c98..5e189aa3ef1 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -68,11 +68,6 @@ end } end - configuration { "vs*" } - flags { - "Unicode", - } - configuration { "winstore*" } -- Windows Required Files files { diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index f310a11360c..be1f27e9319 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -94,14 +94,6 @@ function maintargetosdoptions(_target,_subtarget) links { "psapi", } - configuration { "mingw*" } - linkoptions{ - "-municode", - } - configuration { "vs*" } - flags { - "Unicode", - } configuration {} elseif _OPTIONS["targetos"]=="haiku" then links { diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua index e606e5ad1ea..7e74e43f911 100644 --- a/scripts/src/osd/sdl_cfg.lua +++ b/scripts/src/osd/sdl_cfg.lua @@ -107,7 +107,6 @@ if _OPTIONS["targetos"]=="windows" then defines { "UNICODE", "_UNICODE", - "main=utf8_main", "_WIN32_WINNT=0x0501", "WIN32_LEAN_AND_MEAN", "NOMINMAX", diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua index f0e301e79e1..00432b75a8e 100644 --- a/scripts/src/osd/windows.lua +++ b/scripts/src/osd/windows.lua @@ -16,9 +16,6 @@ function maintargetosdoptions(_target,_subtarget) osdmodulestargetconf() configuration { "mingw*" } - linkoptions { - "-municode", - } links { "mingw32", } diff --git a/scripts/src/osd/windows_cfg.lua b/scripts/src/osd/windows_cfg.lua index 1baa45f4255..73598da6760 100644 --- a/scripts/src/osd/windows_cfg.lua +++ b/scripts/src/osd/windows_cfg.lua @@ -10,8 +10,7 @@ defines { configuration { "mingw* or vs*" } defines { "UNICODE", - "_UNICODE", - "main=utf8_main", + "_UNICODE" } configuration { "vs*" } |