| ... | @@ -401,7 +401,7 @@ pub fn translate( | ... | @@ -401,7 +401,7 @@ pub fn translate( |
| 401 | .name = decl.name, | 401 | .name = decl.name, |
| 402 | .init = try Tag.import_builtin.create(context.arena, decl.name), | 402 | .init = try Tag.import_builtin.create(context.arena, decl.name), |
| 403 | }); | 403 | }); |
| 404 | try context.global_scope.nodes.append(builtin); | 404 | try addTopLevelDecl(&context, decl.name, builtin); |
| 405 | } | 405 | } |
| 406 | } | 406 | } |
| 407 | | 407 | |
| ... | @@ -5347,7 +5347,10 @@ fn transPreprocessorEntities(c: *Context, unit: *clang.ASTUnit) Error!void { | ... | @@ -5347,7 +5347,10 @@ fn transPreprocessorEntities(c: *Context, unit: *clang.ASTUnit) Error!void { |
| 5347 | }, | 5347 | }, |
| 5348 | .Nl, .Eof => { | 5348 | .Nl, .Eof => { |
| 5349 | // this means it is a macro without a value | 5349 | // this means it is a macro without a value |
| 5350 | // we don't care about such things | 5350 | // We define it as an empty string so that it can still be used with ++ |
| | 5351 | const str_node = try Tag.string_literal.create(c.arena, "\"\""); |
| | 5352 | const var_decl = try Tag.pub_var_simple.create(c.arena, .{ .name = name, .init = str_node }); |
| | 5353 | try c.global_scope.macro_table.put(name, var_decl); |
| 5351 | continue; | 5354 | continue; |
| 5352 | }, | 5355 | }, |
| 5353 | .LParen => { | 5356 | .LParen => { |