feat 重构stream流API并适配lex_parse和lexer

This commit is contained in:
zzy
2025-12-08 23:04:11 +08:00
parent 1ab07a5815
commit 36bff64a91
17 changed files with 402 additions and 244 deletions

View File

@@ -16,6 +16,16 @@
#define log_exit exit
#endif
#ifdef __GNUC__ // GCC, Clang, ICC
#define __smcc_log_unreachable() (__builtin_unreachable())
#elif defined _MSC_VER // MSVC
#define __smcc_log_unreachable() (__assume(false))
#elif defined __SMCC_BUILT_IN__ // The SMCC (my compiler)
#define __smcc_log_unreachable() (__smcc_builtin_unreachable())
#else
#define __smcc_log_unreachable()
#endif
#ifndef log_snprintf
#define log_snprintf(...)
#warning "log_snprintf not defined"
@@ -172,6 +182,8 @@ void logger_destroy(logger_t *logger);
do { \
if (!(cond)) { \
LOG_FATAL(__VA_ARGS__); \
log_exit(1); \
__smcc_log_unreachable(); \
} \
} while (0)