#pragma once #include #include /// Get the last error. const char* get_error(void); extern xlstring g_error; /// Log an error. #define log_error(...) \ { \ if (g_error.length == 0) { \ g_error.length = snprintf(g_error.str, xlstring_size, __VA_ARGS__); \ } else { \ xlstring head; \ head.length = snprintf(head.str, xlstring_size, __VA_ARGS__); \ xlstring_append(&head, xlstring_make(": ")); \ g_error = xlstring_concat(head, g_error); \ } \ }