aboutsummaryrefslogtreecommitdiff
path: root/std/fmt/index.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-02-11 16:07:40 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-02-11 16:07:40 -0500
commit90b8cd4a45bcb2ca131b6ed6466f799aaa162d13 (patch)
treedc1d0051b504f8fdff0cd677c0e901fc5aca651f /std/fmt/index.zig
parent342bca7f4627454435e9f6c2d12b099f95a2fd47 (diff)
downloadzig-90b8cd4a45bcb2ca131b6ed6466f799aaa162d13.tar.gz
zig-90b8cd4a45bcb2ca131b6ed6466f799aaa162d13.zip
add C pointer type to @typeInfo
See #1059
Diffstat (limited to 'std/fmt/index.zig')
-rw-r--r--std/fmt/index.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/std/fmt/index.zig b/std/fmt/index.zig
index 05b028112f..b09fe21032 100644
--- a/std/fmt/index.zig
+++ b/std/fmt/index.zig
@@ -236,6 +236,9 @@ pub fn formatType(
const casted_value = ([]const u8)(value);
return output(context, casted_value);
},
+ builtin.TypeInfo.Pointer.Size.C => {
+ return format(context, Errors, output, "{}@{x}", @typeName(T.Child), @ptrToInt(value));
+ },
},
builtin.TypeId.Array => |info| {
if (info.child == u8) {