zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 98eea963deb85d2174262d5f45ddd614a7906231 (tree)
parent eb010ce65ddddb23ceddae86d377432cf1b2b01c
Author: Evan Haas <evan@lagerdata.com>
Date:   Mon, 26 Jul 2021 12:08:29 -0700

translate-c: fix import path in translation failure comment

Diffstat:
Msrc/translate_c.zig | 4++--
Mtest/run_translated_c.zig | 2+-
Mtest/translate_c.zig | 4++--
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/translate_c.zig b/src/translate_c.zig @@ -1969,7 +1969,7 @@ fn transBuiltinFnExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used: const node = try transExpr(c, scope, expr, used); if (node.castTag(.identifier)) |ident| { const name = ident.data; - if (!isBuiltinDefined(name)) return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "TODO implement function '{s}' in std.c.builtins", .{name}); + if (!isBuiltinDefined(name)) return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "TODO implement function '{s}' in std.zig.c_builtins", .{name}); } return node; } @@ -5574,7 +5574,7 @@ fn parseCPrimaryExprInner(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!N .Identifier => { const mangled_name = scope.getAlias(slice); if (mem.startsWith(u8, mangled_name, "__builtin_") and !isBuiltinDefined(mangled_name)) { - try m.fail(c, "TODO implement function '{s}' in std.c.builtins", .{mangled_name}); + try m.fail(c, "TODO implement function '{s}' in std.zig.c_builtins", .{mangled_name}); return error.ParseError; } const identifier = try Tag.identifier.create(c.arena, builtin_typedef_map.get(mangled_name) orelse mangled_name); diff --git a/test/run_translated_c.zig b/test/run_translated_c.zig @@ -1243,7 +1243,7 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void { \\} , ""); - // See __builtin_alloca_with_align comment in std.c.builtins + // See __builtin_alloca_with_align comment in std.zig.c_builtins cases.add("use of unimplemented builtin in unused function does not prevent compilation", \\#include <stdlib.h> \\void unused() { diff --git a/test/translate_c.zig b/test/translate_c.zig @@ -3461,11 +3461,11 @@ pub fn addCases(cases: *tests.TranslateCContext) void { \\pub const MAY_NEED_PROMOTION_OCT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0o20000000000, .octal); }); - // See __builtin_alloca_with_align comment in std.c.builtins + // See __builtin_alloca_with_align comment in std.zig.c_builtins cases.add("demote un-implemented builtins", \\#define FOO(X) __builtin_alloca_with_align((X), 8) , &[_][]const u8{ - \\pub const FOO = @compileError("TODO implement function '__builtin_alloca_with_align' in std.c.builtins"); + \\pub const FOO = @compileError("TODO implement function '__builtin_alloca_with_align' in std.zig.c_builtins"); }); cases.add("null sentinel arrays when initialized from string literal. Issue #8256",