mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
ability to implicitly cast integer literal to &const Int
where Int is an integer type also introduce `@intToPtr` builtin for converting a usize to a pointer. users now have to use this instead of `(&T)(int)`. closes #311
This commit is contained in:
1 parent
ffb4852012
commit
f7e9d7aa5d
8 files changed
+116
-101
No files matched your search
@@ -4326,6 +4326,7 @@ static void define_builtin_fns(CodeGen *g) {
|
||||
create_builtin_fn(g, BuiltinFnIdSetGlobalLinkage, "setGlobalLinkage", 2);
|
||||
create_builtin_fn(g, BuiltinFnIdPanic, "panic", 1);
|
||||
create_builtin_fn(g, BuiltinFnIdPtrCast, "ptrcast", 2);
|
||||
create_builtin_fn(g, BuiltinFnIdIntToPtr, "intToPtr", 2);
|
||||
}
|
||||
|
||||
static void add_compile_var(CodeGen *g, const char *name, ConstExprValue *value) {
|
||||
|
||||
Reference in new issue
Block a user