mame/scripts/src/osd/windows_cfg.lua
npwoods 3d553eda60 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.
2017-09-18 20:28:53 -04:00

59 lines
800 B
Lua

-- license:BSD-3-Clause
-- copyright-holders:MAMEdev Team
defines {
"OSD_WINDOWS",
"WIN32_LEAN_AND_MEAN",
"NOMINMAX",
}
configuration { "mingw* or vs*" }
defines {
"UNICODE",
"_UNICODE"
}
configuration { "vs*" }
flags {
"Unicode",
}
configuration { }
if not _OPTIONS["MODERN_WIN_API"] then
_OPTIONS["MODERN_WIN_API"] = "0"
end
if _OPTIONS["MODERN_WIN_API"]=="1" then
defines {
"WINVER=0x0602",
"_WIN32_WINNT=0x0602",
"NTDDI_VERSION=0x06030000",
"MODERN_WIN_API",
}
else
defines {
"_WIN32_WINNT=0x0501",
}
end
if not _OPTIONS["DONT_USE_NETWORK"] then
defines {
"USE_NETWORK",
"OSD_NET_USE_PCAP",
}
end
if _OPTIONS["USE_SDL"]=="1" then
defines {
"SDLMAME_SDL2=1",
"USE_XINPUT=0",
"USE_SDL=1",
"USE_SDL_SOUND",
}
else
defines {
"USE_SDL=0",
}
end