Use #defines for Int aliasing

This commit is contained in:
Bruce Hill 2024-02-17 19:54:32 -05:00
parent dd2de31666
commit 30c5b1ec25
2 changed files with 9 additions and 2 deletions

View File

@ -63,7 +63,6 @@
.random=KindOfInt##__random, \
};
DEFINE_INT_TYPE(int64_t, Int, "ld", labs, INT64_MIN, INT64_MAX);
DEFINE_INT_TYPE(int64_t, Int64, "ld", labs, INT64_MIN, INT64_MAX);
DEFINE_INT_TYPE(int32_t, Int32, "d_i32", abs, INT32_MIN, INT32_MAX);
DEFINE_INT_TYPE(int16_t, Int16, "d_i16", abs, INT16_MIN, INT16_MAX);

View File

@ -23,11 +23,19 @@
} type_name##_namespace_t; \
extern type_name##_namespace_t type_name##_type;
DEFINE_INT_TYPE(int64_t, Int);
DEFINE_INT_TYPE(int64_t, Int64);
DEFINE_INT_TYPE(int32_t, Int32);
DEFINE_INT_TYPE(int16_t, Int16);
DEFINE_INT_TYPE(int8_t, Int8);
#undef DEFINE_INT_TYPE
#define Int__as_str Int64__as_str
#define Int__compare Int64__compare
#define Int__format Int64__format
#define Int__hex Int64__hex
#define Int__octal Int64__octal
#define Int__random Int64__random
#define Int_namespace_t Int64_namespace_t
#define Int_type Int64_type
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0