diff --git a/stage0/include/core_map.h b/stage0/include/core_map.h index bb42b76..f1cdbd6 100644 --- a/stage0/include/core_map.h +++ b/stage0/include/core_map.h @@ -9,8 +9,16 @@ #ifndef nullptr #define nullptr NULL #endif + +#ifndef SPL_USIZE +#define SPL_USIZE typedef uintptr_t usize; +#endif + +#ifndef SPL_ISIZE +#define SPL_ISIZE typedef intptr_t isize; +#endif #define MAP_TYPEOF __typeof__ @@ -165,7 +173,7 @@ static inline usize map_hash_str(const char *s) { while ((map).data[_idx].state != __MAP_SLOT_EMPTY) { \ if ((map).data[_idx].state == __MAP_SLOT_OCCUPIED && \ (map).cmp((map).data[_idx].key, _key) == 0) { \ - break; /* 已存在,不更新 */ \ + break; /* 已存在,不更新 */ \ } \ if ((map).data[_idx].state == __MAP_SLOT_DELETED && _first_del == (usize) - 1) \ _first_del = _idx; \ diff --git a/stage2/sys/spl_rt.h b/stage2/sys/spl_rt.h index 56d1382..4f935d8 100644 --- a/stage2/sys/spl_rt.h +++ b/stage2/sys/spl_rt.h @@ -31,8 +31,16 @@ typedef unsigned int u32; typedef signed int i32; typedef unsigned long long u64; typedef signed long long i64; + +#ifndef SPL_USIZE typedef u64 usize; +#define SPL_USIZE +#endif + +#ifndef SPL_ISIZE typedef i64 isize; +#define SPL_ISIZE +#endif /* 注:不定义 bool/true/false,避免与 C23 关键字冲突;生成代码用 u8 表示布尔。 */ /* ---- panic / trap ---- */