you don't have to request a console on windows
This commit is contained in:
parent
ac3671def5
commit
39fdbdf798
26
src/main.cpp
26
src/main.cpp
|
@ -1,7 +1,3 @@
|
||||||
#if defined(WIN32) || defined(WIN32) || defined(__WIN32)
|
|
||||||
#include <Windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
@ -13,21 +9,6 @@
|
||||||
#include "parse.hpp"
|
#include "parse.hpp"
|
||||||
#include "runtime.hpp"
|
#include "runtime.hpp"
|
||||||
|
|
||||||
bool request_console();
|
|
||||||
|
|
||||||
// Must request console on Windows
|
|
||||||
#if defined(WIN32) || defined(WIN32) || defined(__WIN32)
|
|
||||||
bool request_console()
|
|
||||||
{
|
|
||||||
return AllocConsole();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
bool request_console()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::ifstream get_infile(int argc, char ** argv)
|
std::ifstream get_infile(int argc, char ** argv)
|
||||||
{
|
{
|
||||||
if(argc != 2)
|
if(argc != 2)
|
||||||
|
@ -54,13 +35,6 @@ int main(int argc, char * argv[])
|
||||||
std::stringstream buffer;
|
std::stringstream buffer;
|
||||||
buffer << infile.rdbuf();
|
buffer << infile.rdbuf();
|
||||||
|
|
||||||
// On Windows, we have to explicitly request a console
|
|
||||||
/*if(!request_console())
|
|
||||||
{
|
|
||||||
std::cerr << "Failed to get console!" << std::endl;
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
std::vector<Instruction> instructions = parse_instructions(buffer.str());
|
std::vector<Instruction> instructions = parse_instructions(buffer.str());
|
||||||
|
|
||||||
Runtime rt(instructions);
|
Runtime rt(instructions);
|
||||||
|
|
Loading…
Reference in a new issue