Open andrewrk opened 6 years ago
Is this a safe/correct substitution? const foo = 1
permanently introduces foo
into the global namespace, while #define
might be followed by an #undef
later on in the file.
@andrewrk
afaik, zig is able to translate integer literal macro's for a long time
0.10.0-dev.2306+50a5ddecc
result this
...
pub export fn bar() c_int {
return 1;
}
...
pub const foo = @as(c_int, 1);
The goal of this issue is to translate that as:
...
pub export fn bar() c_int {
return foo;
}
...
pub const foo = @as(c_int, 1);
sorry, my bad
should translate to:
clue: