Index: mod/kcore/type.h.m ================================================================== --- mod/kcore/type.h.m +++ mod/kcore/type.h.m @@ -90,20 +90,31 @@ kcendian_high, kcendian_low, kcendian_system = cat(kcendian_,prop_endian), } kcendian; -enum /* max-min values of each type */ { - byte_bits = arch_byte_bits, +define(“defval”,“#define $1 $2 +”) + +defval(byte_bits,arch_byte_bits) + + +/* this section was originally defined with enums so + * as to avoid creating extraneous macros; however, + * enum in C is limited to values of type int, when + * we need values that are considerably longer. the + * section has been commented out until someone has + * the energy to convert it to #defines. +enum { u8_min = 0, u8_max = ((u8)-1), u16_min = 0, u16_max = ((u16)-1), u32_min = 0, u32_max = ((u32)-1), u64_min = 0, u64_max = ((u64)-1), u128_min = 0, u128_max = ((u128)-1), - /* assuming two's complement. TODO: check math */ + // assuming two's complement. TODO: check math define(“sspec”,“ $1_min = 0 - ((1 << sizeof($1) * byte_bits) / 2), $1_max = (1 << sizeof($1) * byte_bits) / 2 - 1”)dnl sspec(s8), sspec(s16), sspec(s32), @@ -125,10 +136,11 @@ sbig_min = s128_min, sbig_max = s128_max, ubyte_min = kc_uchar_min, ubyte_max = kc_uchar_max, sbyte_min = kc_schar_min, sbyte_max = kc_schar_max, }; +*/ ifdef(“type_sz”,“ typedef type_sz sz; ”,“dnl # ifdef __cplusplus