From afc5496d0e5c8648a7bb8052f5ca9ff5855b2e83 Mon Sep 17 00:00:00 2001 From: DeFiDude <59237470+DeFiDude@users.noreply.github.com> Date: Sat, 25 Apr 2026 20:36:11 -0600 Subject: [PATCH] build: restore native17 + ignore destination_table runtime cache --- .gitignore | 1 + src/Log.h | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.gitignore b/.gitignore index 89cc49c..4c74948 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .vscode/c_cpp_properties.json .vscode/launch.json .vscode/ipch +destination_table diff --git a/src/Log.h b/src/Log.h index 2a4fbd1..b52ac51 100644 --- a/src/Log.h +++ b/src/Log.h @@ -2,6 +2,32 @@ #ifdef ARDUINO #include +#else +// Native-target shims: debug instrumentation in Transport/Destination/Link uses +// Arduino's `Serial`, `millis()`, `delay()`, `random()`, and ESP32's +// `ESP.getFreeHeap()`. Provide no-op stand-ins so the same code compiles +// cleanly on the native unit-test target. +#include +namespace _rns_native_compat { + struct SerialShim { + template void print(A&&...) {} + template void println(A&&...) {} + template void printf(A&&...) {} + void flush() {} + void begin(int) {} + }; + struct ESPShim { + size_t getFreeHeap() const { return 0; } + size_t getFreePsram() const { return 0; } + size_t getPsramSize() const { return 0; } + }; +} +inline _rns_native_compat::SerialShim Serial; +inline _rns_native_compat::ESPShim ESP; +inline unsigned long millis() { return 0; } +inline void delay(unsigned long) {} +inline long random(long min, long max) { return min; } +inline long random(long max) { return 0; } #endif #include