hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit d5c8418cc83900114ef139ea3d9e24989c371460
parent 229426324f5335b11abff307a3432f5cbc45cd7a
Author: Sebastian <sebastian@sebsite.pw>
Date:   Tue, 17 Oct 2023 21:07:12 -0400

types::c: make schar and uchar not arch specific

char still needs to be arch specific since it's implementation-defined
whether or not it's signed, but char's size is guaranteed to be one
byte, so schar and uchar will always have the same definition.

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mtypes/c/arch+aarch64.ha | 18------------------
Mtypes/c/arch+riscv64.ha | 18------------------
Mtypes/c/arch+x86_64.ha | 18------------------
Mtypes/c/types.ha | 18++++++++++++++++++
4 files changed, 18 insertions(+), 54 deletions(-)

diff --git a/types/c/arch+aarch64.ha b/types/c/arch+aarch64.ha @@ -12,24 +12,6 @@ export def CHAR_MIN: char = UCHAR_MIN; // Maximum value which can be stored in a [[char]] type. export def CHAR_MAX: char = UCHAR_MAX; -// Integer type compatible with `signed char`, as specified by ISO/IEC 9899. -export type schar = i8; - -// Minimum value which can be stored in an [[schar]] type. -export def SCHAR_MIN: schar = types::I8_MIN; - -// Maximum value which can be stored in an [[schar]] type. -export def SCHAR_MAX: schar = types::I8_MAX; - -// Integer type compatible with `unsigned char`, as specified by ISO/IEC 9899. -export type uchar = u8; - -// Minimum value which can be stored in a [[uchar]] type. -export def UCHAR_MIN: uchar = types::U8_MIN; - -// Maximum value which can be stored in a [[uchar]] type. -export def UCHAR_MAX: uchar = types::U8_MAX; - // Integer type compatible with `signed short`, as specified by ISO/IEC 9899. export type short = i16; diff --git a/types/c/arch+riscv64.ha b/types/c/arch+riscv64.ha @@ -12,24 +12,6 @@ export def CHAR_MIN: char = UCHAR_MIN; // Maximum value which can be stored in a [[char]] type. export def CHAR_MAX: char = UCHAR_MAX; -// Integer type compatible with `signed char`, as specified by ISO/IEC 9899. -export type schar = i8; - -// Minimum value which can be stored in an [[schar]] type. -export def SCHAR_MIN: schar = types::I8_MIN; - -// Maximum value which can be stored in an [[schar]] type. -export def SCHAR_MAX: schar = types::I8_MAX; - -// Integer type compatible with `unsigned char`, as specified by ISO/IEC 9899. -export type uchar = u8; - -// Minimum value which can be stored in a [[uchar]] type. -export def UCHAR_MIN: uchar = types::U8_MIN; - -// Maximum value which can be stored in a [[uchar]] type. -export def UCHAR_MAX: uchar = types::U8_MAX; - // Integer type compatible with `signed short`, as specified by ISO/IEC 9899. export type short = i16; diff --git a/types/c/arch+x86_64.ha b/types/c/arch+x86_64.ha @@ -12,24 +12,6 @@ export def CHAR_MIN: char = SCHAR_MIN; // Maximum value which can be stored in a [[char]] type. export def CHAR_MAX: char = SCHAR_MAX; -// Integer type compatible with `signed char`, as specified by ISO/IEC 9899. -export type schar = i8; - -// Minimum value which can be stored in an [[schar]] type. -export def SCHAR_MIN: schar = types::I8_MIN; - -// Maximum value which can be stored in an [[schar]] type. -export def SCHAR_MAX: schar = types::I8_MAX; - -// Integer type compatible with `unsigned char`, as specified by ISO/IEC 9899. -export type uchar = u8; - -// Minimum value which can be stored in a [[uchar]] type. -export def UCHAR_MIN: uchar = types::U8_MIN; - -// Maximum value which can be stored in a [[uchar]] type. -export def UCHAR_MAX: uchar = types::U8_MAX; - // Integer type compatible with `signed short`, as specified by ISO/IEC 9899. export type short = i16; diff --git a/types/c/types.ha b/types/c/types.ha @@ -3,6 +3,24 @@ use types; +// Integer type compatible with `signed char`, as specified by ISO/IEC 9899. +export type schar = i8; + +// Minimum value which can be stored in an [[schar]] type. +export def SCHAR_MIN: schar = types::I8_MIN; + +// Maximum value which can be stored in an [[schar]] type. +export def SCHAR_MAX: schar = types::I8_MAX; + +// Integer type compatible with `unsigned char`, as specified by ISO/IEC 9899. +export type uchar = u8; + +// Minimum value which can be stored in a [[uchar]] type. +export def UCHAR_MIN: uchar = types::U8_MIN; + +// Maximum value which can be stored in a [[uchar]] type. +export def UCHAR_MAX: uchar = types::U8_MAX; + // Integer type compatible with `char8_t`, as defined in <uchar.h> and specified // by ISO/IEC 9899:2023. export type char8 = uchar;