diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-01-03 22:38:13 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-01-03 22:38:13 -0500 |
| commit | 0cd63b28f32fdf5aaedf9daa8ff60ec58de2f7f4 (patch) | |
| tree | 7c8fa7fcc53b2a9a9199bdbaed669cc165a5dba2 /build.zig | |
| parent | 477e3f64fc632cc87956a9a6354c9069b93d5919 (diff) | |
| download | zig-0cd63b28f32fdf5aaedf9daa8ff60ec58de2f7f4.tar.gz zig-0cd63b28f32fdf5aaedf9daa8ff60ec58de2f7f4.zip | |
fix self-hosted build on windows
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -209,8 +209,19 @@ pub fn installCHeaders(b: &Builder, c_header_files: []const u8) { fn nextValue(index: &usize, build_info: []const u8) -> []const u8 { const start = *index; - while (build_info[*index] != '\n' and build_info[*index] != '\r') : (*index += 1) { } - const result = build_info[start..*index]; - *index += 1; - return result; + while (true) : (*index += 1) { + switch (build_info[*index]) { + '\n' => { + const result = build_info[start..*index]; + *index += 1; + return result; + }, + '\r' => { + const result = build_info[start..*index]; + *index += 2; + return result; + }, + else => continue, + } + } } |
