update to work on windows

This commit is contained in:
Rokas Puzonas 2025-12-27 21:24:22 +02:00
parent a8604946f6
commit 0349bfe50b
2 changed files with 12 additions and 9 deletions

View File

@ -2,6 +2,9 @@
#include "stdio.h"
#include "stdbool.h"
#include <stdint.h>
#ifdef _WIN32
#include <windows.h>
#endif
#define FONTSTASH_IMPLEMENTATION
#include "fontstash.h"

View File

@ -84,22 +84,22 @@ pub fn main() !void {
var debug_allocator: std.heap.DebugAllocator(.{}) = .init;
defer _ = debug_allocator.deinit();
if (builtin.mode == .ReleaseFast) {
gpa = std.heap.smp_allocator;
} else {
if (builtin.mode == .Debug) {
gpa = debug_allocator.allocator();
} else {
gpa = std.heap.smp_allocator;
}
// TODO: Use tracy TracingAllocator
tracy.setThreadName("Main");
var sa: std.posix.Sigaction = .{
.handler = .{ .handler = signalHandler },
.mask = std.posix.sigemptyset(),
.flags = std.posix.SA.RESTART,
};
std.posix.sigaction(std.posix.SIG.INT, &sa, null);
// var sa: std.posix.Sigaction = .{
// .handler = .{ .handler = signalHandler },
// .mask = std.posix.sigemptyset(),
// .flags = std.posix.SA.RESTART,
// };
// std.posix.sigaction(std.posix.SIG.INT, &sa, null);
sapp.run(.{
.init_cb = init,