Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ziglang/zig
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 942b25089558
Choose a base ref
...
head repository: ziglang/zig
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dd3437d5ba30
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 4, 2017

  1. Copy the full SHA
    084911d View commit details
  2. Copy the full SHA
    54138d9 View commit details
  3. fix build on windows

    andrewrk committed Dec 4, 2017
    Copy the full SHA
    dd3437d View commit details
Showing with 25 additions and 2 deletions.
  1. +2 −2 std/os/child_process.zig
  2. +23 −0 test/cases/union.zig
4 changes: 2 additions & 2 deletions std/os/child_process.zig
Original file line number Diff line number Diff line change
@@ -213,9 +213,9 @@ pub const ChildProcess = struct {
self.term = (%Term)({
var exit_code: windows.DWORD = undefined;
if (windows.GetExitCodeProcess(self.handle, &exit_code) == 0) {
Term.Unknown{0}
Term { .Unknown = 0 }
} else {
Term.Exited {@bitCast(i32, exit_code)}
Term { .Exited = @bitCast(i32, exit_code)}
}
});

23 changes: 23 additions & 0 deletions test/cases/union.zig
Original file line number Diff line number Diff line change
@@ -150,3 +150,26 @@ fn testEnumWithSpecifiedAndUnspecifiedTagValues(x: &const MultipleChoice2) {
});
}


const ExternPtrOrInt = extern union {
ptr: &u8,
int: u64
};
test "extern union size" {
comptime assert(@sizeOf(ExternPtrOrInt) == 8);
}

const PackedPtrOrInt = packed union {
ptr: &u8,
int: u64
};
test "extern union size" {
comptime assert(@sizeOf(PackedPtrOrInt) == 8);
}

const ZeroBits = union {
OnlyField: void,
};
test "union with only 1 field which is void should be zero bits" {
comptime assert(@sizeOf(ZeroBits) == 0);
}