Standardizing wchar->char in main().
This commit is contained in:
parent
c8b544ffd4
commit
c93b93fe55
|
@ -13,6 +13,8 @@
|
||||||
#include <gflags/gflags.h>
|
#include <gflags/gflags.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
// Autogenerated by `xb premake`.
|
// Autogenerated by `xb premake`.
|
||||||
#include "build/version.h"
|
#include "build/version.h"
|
||||||
|
|
||||||
|
@ -72,7 +74,7 @@ int Main() {
|
||||||
for (int n = 0; n < argca; n++) {
|
for (int n = 0; n < argca; n++) {
|
||||||
size_t len = wcslen(argv[n]);
|
size_t len = wcslen(argv[n]);
|
||||||
argva[n] = reinterpret_cast<char*>(alloca(len + 1));
|
argva[n] = reinterpret_cast<char*>(alloca(len + 1));
|
||||||
wcstombs_s(nullptr, argva[n], len + 1, argv[n], _TRUNCATE);
|
std::wcstombs(argva[n], argv[n], len + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse flags; this may delete some of them.
|
// Parse flags; this may delete some of them.
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#include <gflags/gflags.h>
|
#include <gflags/gflags.h>
|
||||||
|
|
||||||
#include <codecvt>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -33,7 +33,7 @@ int main(int argc, wchar_t* argv[]) {
|
||||||
for (int n = 0; n < argca; n++) {
|
for (int n = 0; n < argca; n++) {
|
||||||
size_t len = wcslen(argv[n]);
|
size_t len = wcslen(argv[n]);
|
||||||
argva[n] = (char*)alloca(len + 1);
|
argva[n] = (char*)alloca(len + 1);
|
||||||
wcstombs_s(nullptr, argva[n], len + 1, argv[n], _TRUNCATE);
|
std::wcstombs(argva[n], argv[n], len + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse flags; this may delete some of them.
|
// Parse flags; this may delete some of them.
|
||||||
|
|
Loading…
Reference in New Issue