Hopefully better ifdefs for checking OS so the ci doesn't error
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
_13, _14, _15, _16, _17, _18, \
|
||||
_19, _20, _21, _22, _23, _24, \
|
||||
NAME, ...) NAME
|
||||
#ifdef _MSC_VER
|
||||
#ifdef SLIME_WINDOWS
|
||||
#define EXPAND( x ) x
|
||||
#define fetch(...) EXPAND( \
|
||||
GET_MACRO( \
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER) || defined(_WIN32) || defined(WIN32) || defined(_WIN64)
|
||||
# define SLIME_WINDOWS
|
||||
# define debug_break() if_debug __debugbreak()
|
||||
# define if_windows if constexpr (true)
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@
|
||||
#include <errno.h>
|
||||
#include <new>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#if defined(_MSC_VER) || defined(_WIN32) || defined(WIN32) || defined(_WIN64)
|
||||
# include <direct.h>
|
||||
# include <windows.h>
|
||||
#else
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#include "libslime.cpp"
|
||||
|
||||
s32 main(s32 argc, char* argv[]) {
|
||||
#ifdef _MSC_VER
|
||||
#ifdef SLIME_WINDOWS
|
||||
// enable colored terminal output for windows
|
||||
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
DWORD dwMode = 0;
|
||||
|
||||
+5
-5
@@ -4,7 +4,7 @@ namespace Slime {
|
||||
const u32 buf_size = 2048;
|
||||
char* res = (char*)malloc(buf_size * sizeof(char));
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef SLIME_WINDOWS
|
||||
_getcwd(res, buf_size);
|
||||
#else
|
||||
getcwd(res, buf_size);
|
||||
@@ -14,7 +14,7 @@ namespace Slime {
|
||||
}
|
||||
|
||||
inline proc change_cwd(char* dir) -> void {
|
||||
#ifdef _MSC_VER
|
||||
#ifdef SLIME_WINDOWS
|
||||
_chdir(dir);
|
||||
#else
|
||||
chdir(dir);
|
||||
@@ -22,7 +22,7 @@ namespace Slime {
|
||||
}
|
||||
|
||||
inline proc duplicate_c_string(const char* str) -> char* {
|
||||
#ifdef _MSC_VER
|
||||
#ifdef SLIME_WINDOWS
|
||||
return _strdup(str);
|
||||
#else
|
||||
return strdup(str);
|
||||
@@ -30,7 +30,7 @@ namespace Slime {
|
||||
}
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef SLIME_WINDOWS
|
||||
s32 vasprintf(char **strp, const char *fmt, va_list ap) {
|
||||
// _vscprintf tells you how big the buffer needs to be
|
||||
s32 len = _vscprintf(fmt, ap);
|
||||
@@ -62,7 +62,7 @@ namespace Slime {
|
||||
#endif
|
||||
|
||||
proc get_exe_dir() -> path_char* {
|
||||
#ifdef _MSC_VER
|
||||
#ifdef SLIME_WINDOWS
|
||||
DWORD last_error;
|
||||
DWORD result;
|
||||
DWORD path_size = MAX_PATH;
|
||||
|
||||
Reference in New Issue
Block a user