stdlib: Make stdlib not error out w/ undefined symbols, add ranges.
This commit is contained in:
parent
4d9b13f7a1
commit
5c99bf09ab
@ -8,5 +8,7 @@ pub mod num;
|
|||||||
|
|
||||||
pub mod str;
|
pub mod str;
|
||||||
|
|
||||||
|
pub mod range;
|
||||||
|
|
||||||
#[cfg("test")]
|
#[cfg("test")]
|
||||||
mod test;
|
mod test;
|
||||||
|
@ -278,9 +278,9 @@ pub mod ops {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl usize {
|
impl usize {
|
||||||
pub const MIN: Self = __march_ptr_width_unsigned_min();
|
pub const MIN: Self = (); // __march_ptr_width_unsigned_min(); // TODO: intrinsics
|
||||||
pub const MAX: Self = __march_ptr_width_unsigned_max();
|
pub const MAX: Self = (); // __march_ptr_width_unsigned_max(); // TODO: intrinsics
|
||||||
pub const BIT_WIDTH: u32 = __march_ptr_width_bits();
|
pub const BIT_WIDTH: u32 = (); // __march_ptr_width_bits(); // TODO: intrinsics
|
||||||
pub fn default() -> Self {
|
pub fn default() -> Self {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
@ -512,9 +512,9 @@ pub mod ops {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl isize {
|
impl isize {
|
||||||
pub const MIN: Self = __march_ptr_width_signed_min();
|
pub const MIN: Self = (); // __march_ptr_width_signed_min(); // TODO: intrinsics
|
||||||
pub const MAX: Self = __march_ptr_width_signed_max();
|
pub const MAX: Self = (); // __march_ptr_width_signed_max(); // TODO: intrinsics
|
||||||
pub const BIT_WIDTH: u32 = __march_ptr_width_bits();
|
pub const BIT_WIDTH: u32 = (); // __march_ptr_width_bits(); // TODO: intrinsics
|
||||||
pub fn default() -> Self {
|
pub fn default() -> Self {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
9
stdlib/std/range.cl
Normal file
9
stdlib/std/range.cl
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//! Iterable ranges
|
||||||
|
|
||||||
|
/// An Exclusive Range `a .. b` iterates from a to b, excluding b
|
||||||
|
#[intrinsic = "range_exc", T]
|
||||||
|
struct RangeExc(T, T)
|
||||||
|
|
||||||
|
/// An Inclusive Range `a ..= b` iterates from a to b, including b
|
||||||
|
#[intrinsic = "range_inc", T]
|
||||||
|
struct RangeInc(T, T)
|
Loading…
x
Reference in New Issue
Block a user