Skip to content

Commit

Permalink
Undefine possible win32 macro
Browse files Browse the repository at this point in the history
  • Loading branch information
eschan145 committed Jan 19, 2025
1 parent 313a975 commit b721a9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ void set_kill_method(int value) {
default_kill_method = static_cast<KillMethod>(value);
}

void system(const std::string& command) {
STARTUPINFO si = { sizeof(STARTUPINFO) };
bool system(const std::string& command) {
STARTUPINFO si = {sizeof(STARTUPINFO)};
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;

Expand All @@ -310,6 +310,8 @@ void system(const std::string& command) {
// Close process and thread handles
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);

return true;
}

bool taskkill(DWORD identifier, KillMethod method) {
Expand Down
4 changes: 3 additions & 1 deletion src/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Compile with g++ -shared -o api.dll api.cpp -Ofast -fPIC -shared
#include "asteroids.h"
#include "settings.h"

#undef WIN32

#pragma comment(lib, "wininet.lib")


Expand Down Expand Up @@ -81,7 +83,7 @@ KillMethod default_kill_method = KillMethod::WIN32;

namespace dieknow {

void system(const std::string& command);
bool system(const std::string& command);

bool taskkill(DWORD identifier, KillMethod method = KillMethod::WIN32);

Expand Down

0 comments on commit b721a9c

Please sign in to comment.