#include "stdlib.h" static Console* global_console = nullptr; void Console::set(Console* ptr) { if (ptr != nullptr) { global_console = ptr; } } Console* Console::get() { return global_console; } void abort() { /* * On gcc, a 'while(true) {}' will infinitely loop * but clang will optimize it away on -O2 if it's empty * therefore, add no-op */ while (true) { asm volatile("nop"); } __builtin_unreachable(); }