diff --git a/debugger.cpp b/debugger.cpp index d78df6b..7c50e2c 100644 --- a/debugger.cpp +++ b/debugger.cpp @@ -2,7 +2,8 @@ // Released under MIT license #include -#ifdef linux +#include "gen.h" +#if IS_POSIX #include #include #include @@ -18,13 +19,12 @@ #include "console.h" #include "cpu.h" #include "disk_backend.h" -#ifdef linux +#if IS_POSIX #include "disk_backend_file.h" #else #include "disk_backend_esp32.h" #endif #include "disk_backend_nbd.h" -#include "gen.h" #include "loaders.h" #include "log.h" #include "tty.h" @@ -67,7 +67,7 @@ typedef enum { BE_NETWORK, BE_SD } disk_backend_t; #if !defined(BUILD_FOR_RP2040) std::optional, std::vector, std::string> > load_disk_configuration(console *const c) { -#ifdef linux +#if IS_POSIX json_error_t error; json_t *json = json_load_file("." NET_DISK_CFG_FILE, JSON_REJECT_DUPLICATES, &error); if (!json) { @@ -147,7 +147,7 @@ std::optional, std::vector & tape_file, const disk_type_t dt, console *const cnsl) { -#ifdef linux +#if IS_POSIX json_t *json = json_object(); json_object_set(json, "NBD-host", json_string(nbd_host.c_str())); @@ -297,7 +297,7 @@ std::optional, std::vector, std::vector, std::string> > select_disk_files(console *const c) { -#ifdef linux +#if IS_POSIX c->put_string_lf("Files in current directory: "); #else c->debug("MISO: %d", int(MISO)); @@ -377,7 +377,7 @@ std::optional, std::vector, std::vector #include "rp2040.h" @@ -165,7 +167,7 @@ void set_thread_name(std::string name) std::string get_thread_name() { -#ifdef linux +#if IS_POSIX char buffer[16 + 1] { }; pthread_getname_np(pthread_self(), buffer, sizeof buffer);