diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-12-10 11:13:39 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-10 11:13:39 -0500 |
| commit | 9561e7c6b9fb2d9ebcbfd611196db698372ae7bd (patch) | |
| tree | 6b4fd0751e80a9c4128756d59d3c0bfecd230498 /src/translate_c.cpp | |
| parent | cd4d638d10365e47bcb371119dcee22581355ac4 (diff) | |
| parent | 30715560c829d5636734edf7eabff3ee4d170e5d (diff) | |
| download | zig-9561e7c6b9fb2d9ebcbfd611196db698372ae7bd.tar.gz zig-9561e7c6b9fb2d9ebcbfd611196db698372ae7bd.zip | |
Merge branch 'Snektron-typeOf-to-TypeOf'
closes #3875
closes #1348
Diffstat (limited to 'src/translate_c.cpp')
| -rw-r--r-- | src/translate_c.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/translate_c.cpp b/src/translate_c.cpp index 3fe5fced07..eb207231f0 100644 --- a/src/translate_c.cpp +++ b/src/translate_c.cpp @@ -4230,7 +4230,7 @@ static AstNode *resolve_typedef_decl(Context *c, const ZigClangTypedefNameDecl * emit_warning(c, ZigClangTypedefNameDecl_getLocation(typedef_decl), "typedef %s - unresolved child type", buf_ptr(type_name)); c->decl_table.put(typedef_decl, nullptr); - // TODO add global var with type_name equal to @compileError("unable to resolve C type") + // TODO add global var with type_name equal to @compileError("unable to resolve C type") return nullptr; } add_global_var(c, type_name, type_node); @@ -4919,9 +4919,9 @@ static AstNode *parse_ctok_primary_expr(Context *c, CTokenize *ctok, size_t *tok *tok_i += 1; - //if (@typeId(@typeOf(x)) == @import("builtin").TypeId.Pointer) + //if (@typeId(@TypeOf(x)) == @import("builtin").TypeId.Pointer) // @ptrCast(dest, x) - //else if (@typeId(@typeOf(x)) == @import("builtin").TypeId.Integer) + //else if (@typeId(@TypeOf(x)) == @import("builtin").TypeId.Integer) // @intToPtr(dest, x) //else // (dest)(x) @@ -4931,7 +4931,7 @@ static AstNode *parse_ctok_primary_expr(Context *c, CTokenize *ctok, size_t *tok AstNode *typeid_type = trans_create_node_field_access_str(c, import_builtin, "TypeId"); AstNode *typeid_pointer = trans_create_node_field_access_str(c, typeid_type, "Pointer"); AstNode *typeid_integer = trans_create_node_field_access_str(c, typeid_type, "Int"); - AstNode *typeof_x = trans_create_node_builtin_fn_call_str(c, "typeOf"); + AstNode *typeof_x = trans_create_node_builtin_fn_call_str(c, "TypeOf"); typeof_x->data.fn_call_expr.params.append(node_to_cast); AstNode *typeid_value = trans_create_node_builtin_fn_call_str(c, "typeId"); typeid_value->data.fn_call_expr.params.append(typeof_x); |
