| author | |
| committer | |
| log | 72443fb88cfddad8a58868c150eaf5818826cb21 |
| tree | a9a6c191dafeaef86b0c6ebec4fca8aa7cda074a |
| parent | 0909f47f86f05ded749f1382a37b148e0d157ae2 |
2 files changed, 17 insertions(+), 1 deletions(-)
src/translate_c.zig+16| ... | @@ -4926,6 +4926,22 @@ fn isAnyopaque(qt: clang.QualType) bool { | ... | @@ -4926,6 +4926,22 @@ fn isAnyopaque(qt: clang.QualType) bool { |
| 4926 | const typedef_decl = typedef_ty.getDecl(); | 4926 | const typedef_decl = typedef_ty.getDecl(); |
| 4927 | return isAnyopaque(typedef_decl.getUnderlyingType()); | 4927 | return isAnyopaque(typedef_decl.getUnderlyingType()); |
| 4928 | }, | 4928 | }, |
| 4929 | .Elaborated => { | ||
| 4930 | const elaborated_ty = @ptrCast(*const clang.ElaboratedType, ty); | ||
| 4931 | return isAnyopaque(elaborated_ty.getNamedType().getCanonicalType()); | ||
| 4932 | }, | ||
| 4933 | .Decayed => { | ||
| 4934 | const decayed_ty = @ptrCast(*const clang.DecayedType, ty); | ||
| 4935 | return isAnyopaque(decayed_ty.getDecayedType().getCanonicalType()); | ||
| 4936 | }, | ||
| 4937 | .Attributed => { | ||
| 4938 | const attributed_ty = @ptrCast(*const clang.AttributedType, ty); | ||
| 4939 | return isAnyopaque(attributed_ty.getEquivalentType().getCanonicalType()); | ||
| 4940 | }, | ||
| 4941 | .MacroQualified => { | ||
| 4942 | const macroqualified_ty = @ptrCast(*const clang.MacroQualifiedType, ty); | ||
| 4943 | return isAnyopaque(macroqualified_ty.getModifiedType().getCanonicalType()); | ||
| 4944 | }, | ||
| 4929 | else => return false, | 4945 | else => return false, |
| 4930 | } | 4946 | } |
| 4931 | } | 4947 | } |
test/translate_c.zig+1-1| ... | @@ -3026,7 +3026,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -3026,7 +3026,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 3026 | \\pub export fn log2(arg_a: u32) c_int { | 3026 | \\pub export fn log2(arg_a: u32) c_int { |
| 3027 | \\ var a = arg_a; | 3027 | \\ var a = arg_a; |
| 3028 | \\ var i: c_int = 0; | 3028 | \\ var i: c_int = 0; |
| 3029 | \\ while (a > @bitCast(c_uint, @as(c_int, 0))) { | 3029 | \\ while (a > @bitCast(u32, @as(c_int, 0))) { |
| 3030 | \\ a >>= @intCast(@import("std").math.Log2Int(c_int), @as(c_int, 1)); | 3030 | \\ a >>= @intCast(@import("std").math.Log2Int(c_int), @as(c_int, 1)); |
| 3031 | \\ } | 3031 | \\ } |
| 3032 | \\ return i; | 3032 | \\ return i; |