Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update predefined macros #24

Merged
merged 3 commits into from
Sep 16, 2021
Merged

Update predefined macros #24

merged 3 commits into from
Sep 16, 2021

Conversation

ehaas
Copy link
Collaborator

@ehaas ehaas commented Sep 12, 2021

Use correct value of __STDC_VERSION__
Add placeholder values for __DATE__ and __TIME__
Update test runner to create a new compilation for each test since the predefined macros can change based on the test.

src/Compilation.zig Outdated Show resolved Hide resolved
test/runner.zig Outdated
var skip_count: u32 = 0;
for (cases.items) |range| {
// prepare compiler
var comp = aro.Compilation.init(gpa);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you added a builtin field to Source.Id only it would need to be regenerated and all other loaded files would remain. This could also be used to clean a bunch of magic numbers in Compilation.

@ehaas ehaas force-pushed the predefined-macros branch 2 times, most recently from 96db12b to a4d95d2 Compare September 13, 2021 06:48
@ehaas
Copy link
Collaborator Author

ehaas commented Sep 13, 2021

Updated it to use the epoch API you linked, for when that gets merged.

I changed the way the test runner handles the predefined macros but I'm not entirely sure about what you mean regarding removing the magic numbers from Compilation - I assume you mean the + 2's but I don't know how adding a new Id builtin lets me get rid of those.

@Vexu Vexu force-pushed the predefined-macros branch from e109ae1 to 8afe7c3 Compare September 16, 2021 17:07
@Vexu Vexu merged commit f69069d into Vexu:master Sep 16, 2021
@Vexu
Copy link
Owner

Vexu commented Sep 16, 2021

Thanks! I fixed a small off-by-one error in __DATE__, month_day.day_index is [0,30] we want [1,31].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants