diff --git a/src/capi.zig b/src/capi.zig index c4887c012..a463c0243 100644 --- a/src/capi.zig +++ b/src/capi.zig @@ -77,8 +77,10 @@ pub const asSymbolId = c.clAsSymbolId; pub fn asString(val: Value) []const u8 { return fromStr(c.clAsString(val)); } -pub const clTrue = c.clTrue; -pub const clFalse = c.clFalse; +pub const Void = c.CL_VOID; +pub const True = c.CL_TRUE; +pub const False = c.CL_FALSE; +pub const bool_ = c.clBool; pub const asBoxInt = c.clAsBoxInt; pub const int = c.clInt; pub const asBool = c.clAsBool; diff --git a/src/include/cyber.h b/src/include/cyber.h index ba8027c60..e2fc69f01 100644 --- a/src/include/cyber.h +++ b/src/include/cyber.h @@ -23,6 +23,8 @@ typedef struct CLModule CLModule; #define CL_NULLID UINT32_MAX #define CL_VOID 0x7FFC000100000000 +#define CL_TRUE 0x7FFC000200000001 +#define CL_FALSE 0x7FFC000200000000 #define CL_INTERRUPT 0x7ffc00030000ffff typedef int CLResultCode; @@ -532,8 +534,6 @@ CLAllocator clGetAllocator(CLVM* vm); // ----------------------------------- // Create values. -CLValue clTrue(void); -CLValue clFalse(void); CLValue clBool(bool b); CLValue clInt(int64_t n); // Unboxed. diff --git a/src/lib.zig b/src/lib.zig index 775e6eb99..4be0a1014 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -892,8 +892,8 @@ test "clToBool()" { i = vm.newInt(1); try t.eq(c.toBool(i), true); - try t.eq(c.toBool(c.clTrue()), true); - try t.eq(c.toBool(c.clFalse()), false); + try t.eq(c.toBool(c.True), true); + try t.eq(c.toBool(c.False), false); } export fn clAsBool(val: Value) bool { @@ -901,8 +901,8 @@ export fn clAsBool(val: Value) bool { } test "clAsBool()" { - try t.eq(c.asBool(c.clTrue()), true); - try t.eq(c.asBool(c.clFalse()), false); + try t.eq(c.asBool(c.True), true); + try t.eq(c.asBool(c.False), false); } export fn clAsBoxInt(val: Value) i64 {