Skip to content

Commit

Permalink
Fixed macro usage in shell.cpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
Goubermouche committed Jan 3, 2024
1 parent 3c115a1 commit 5b21a06
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions source/utility/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

#ifdef _WIN32
#include <intrin.h>

#define DEBUG_BREAK() __debugbreak()
#define SYSTEM_WINDOWS
#elif __linux__
#include <signal.h>

#define DEBUG_BREAK() raise(SIGTRAP)
#define SYSTEM_LINUX
#else
Expand Down
5 changes: 2 additions & 3 deletions source/utility/shell.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#include "shell.h"
#include "utility/macros.h"

namespace utility {
auto shell::execute(const std::string& command) -> i32 {
#ifdef SYSTEM_WINDOWS
const std::string windows_command = "cmd /c " + command;
return system(windows_command.c_str());
#elif SYSTEM_LINUX
#elif defined SYSTEM_LINUX
return system(command.c_str());
#else
PANIC("unsupported platform detected");
Expand All @@ -17,7 +16,7 @@ namespace utility {
std::string command;
#ifdef SYSTEM_WINDOWS
command = "start " + link;
#elif SYSTEM_LINUX
#elif defined SYSTEM_LINUX
command = "xdg-open " + link;
#else
PANIC("unsupported platform detected");
Expand Down
2 changes: 1 addition & 1 deletion source/utility/shell.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include "utility/types.h"
#include "utility/macros.h"

namespace utility {
/**
Expand Down

0 comments on commit 5b21a06

Please sign in to comment.