Skip to content

Commit

Permalink
windows: add support for the glfw backend on Windows
Browse files Browse the repository at this point in the history
Changes:
- Add WindowsPty, which uses the ConPTY API to create a pseudo console
- Pty now selects between PosixPty and WindowsPty
- Windows support in Command, including the ability to launch a process with a pseudo console
- Enable Command tests on windows
- Add some environment variable abstractions to handle the missing libc APIs on Windows
- Windows version of ReadThread
  • Loading branch information
kcbanner committed Oct 31, 2023
1 parent 533b28e commit 073e5dc
Show file tree
Hide file tree
Showing 13 changed files with 789 additions and 228 deletions.
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
.dependencies = .{
// Zig libs
.libxev = .{
.url = "https://github.com/mitchellh/libxev/archive/5ecbc871f3bfa80fb7bf0fa853866cb93b99bc18.tar.gz",
.hash = "1220416854e424601ecc9814afb461a5dc9cf95db5917d82f794594a58ffc723b82c",
.url = "https://github.com/kcbanner/libxev/archive/d71ddeb19c6697875c2e0e68a49d04c05bc26199.tar.gz",
.hash = "1220a26265c30f5677ce28daf04afbd7a6ef5a17f5d3b5506f767fdfee7dc4225d2b",
},
.mach_glfw = .{
.url = "https://github.com/hexops/mach-glfw/archive/16dc95cc7f74ebbbdd848d9a2c3cc4afc5717708.tar.gz",
Expand Down
7 changes: 2 additions & 5 deletions src/App.zig
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,8 @@ pub fn create(

// Find our resources directory once for the app so every launch
// hereafter can use this cached value.
var resources_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
const resources_dir = if (try internal_os.resourcesDir(&resources_buf)) |dir|
try alloc.dupe(u8, dir)
else
null;
const resources_dir = try internal_os.resourcesDir(alloc);
errdefer if (resources_dir) |dir| alloc.free(dir);

app.* = .{
.alloc = alloc,
Expand Down
Loading

0 comments on commit 073e5dc

Please sign in to comment.