you don't have to request a console on windows

This commit is contained in:
Lauchmelder 2021-11-24 15:00:55 +01:00
parent ac3671def5
commit 39fdbdf798

View file

@ -1,7 +1,3 @@
#if defined(WIN32) || defined(WIN32) || defined(__WIN32)
#include <Windows.h>
#endif
#include <iostream>
#include <string>
#include <fstream>
@ -13,21 +9,6 @@
#include "parse.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)
{
if(argc != 2)
@ -54,13 +35,6 @@ int main(int argc, char * argv[])
std::stringstream buffer;
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());
Runtime rt(instructions);