Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
dschuff committed Aug 31, 2023
commit ccb6f4b2058e3ab45da4f58760ee93d3fecccb69
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -499,5 +499,3 @@ if(EMSCRIPTEN)
endif()

configure_file(scripts/binaryen-lit.in ${CMAKE_BINARY_DIR}/bin/binaryen-lit @ONLY)

#add_executable(testout src/test.cpp)
11 changes: 8 additions & 3 deletions src/support/command-line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
#include "support/command-line.h"
#include "config.h"
#include "support/debug.h"
#include "support/path.h"

#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include "windows.h"
#include "shellapi.h"
#endif
Expand Down Expand Up @@ -171,13 +172,17 @@ Options& Options::add_positional(const std::string& name,

void Options::parse(int argc, const char* argv[]) {

// On Windows, get the wide char version of the command line flags, and convert
// each one to std::string with UTF-8 manually. This means that all paths in
// Binaryen are stored this way on all platforms right up until a library call
// is made to open a file (at which point we use Path::to_path to convert back)
// so that it works with the underlying Win32 APIs.
// Only argList (and not argv) should be used below.
#ifdef _WIN32
LPWSTR* argListW = CommandLineToArgvW(GetCommandLineW(), &argc);
std::vector<std::string> argList;
//std::cerr << "cmd line ";
for (size_t i = 0, e = argc; i < e; ++i) {
argList.push_back(wasm::Path::wstring_to_string(argListW[i]));
//std::cerr << *argListW[i] << " " << argList[i] << "\n";
}
#else
const char** argList = argv;
Expand Down
1 change: 0 additions & 1 deletion src/support/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ T wasm::read_file(const std::string& filename, Flags::BinaryOption binary) {
}
infile.seekg(0, std::ios::end);
std::streampos insize = infile.tellg();
//std::cerr << "insize " <<insize<< " "<<filename;
if (uint64_t(insize) >= std::numeric_limits<size_t>::max()) {
// Building a 32-bit executable where size_t == 32 bits, we are not able to
// create strings larger than 2^32 bytes in length, so must abort here.
Expand Down