zig: switch from stage1 to the new stage2 compiler

stage2 has been merged and set as default around end of aug 2022 in
https://github.com/ziglang/zig/pull/12368. since then the main focus has
been on this new stage2 compiler.

with the release of 0.10.1 the stage2 is fairly useable now and it is
the way forward, towards zig 0.11 or 1.0. read more about difference in
https://github.com/ziglang/zig/wiki/Self-Hosted-Compiler-Upgrade-Guide

another good read on the relevant topic is
https://ziglang.org/news/goodbye-cpp/
pull/20/head
alex 2 years ago
parent c08ded524e
commit 6a93ba9a30
Signed by: x1ddos
GPG Key ID: FDEFB4A63CBD8460

@ -2,8 +2,6 @@ const std = @import("std");
const nifbuild = @import("lib/nif/build.zig"); const nifbuild = @import("lib/nif/build.zig");
pub fn build(b: *std.build.Builder) void { pub fn build(b: *std.build.Builder) void {
b.use_stage1 = true;
const target = b.standardTargetOptions(.{}); const target = b.standardTargetOptions(.{});
const mode = b.standardReleaseOptions(); const mode = b.standardReleaseOptions();
const strip = b.option(bool, "strip", "strip output binary; default: false") orelse false; const strip = b.option(bool, "strip", "strip output binary; default: false") orelse false;

@ -19,10 +19,9 @@ const logger = std.log.scoped(.ngui);
const lvgl_logger = std.log.scoped(.lvgl); // logs LV_LOG_xxx messages const lvgl_logger = std.log.scoped(.lvgl); // logs LV_LOG_xxx messages
extern "c" fn lv_timer_handler() u32; extern "c" fn lv_timer_handler() u32;
extern "c" fn lv_log_register_print_cb(fn (msg: [*:0]const u8) callconv(.C) void) void; extern "c" fn lv_log_register_print_cb(*const fn (msg: [*:0]const u8) callconv(.C) void) void;
const LvTimer = opaque {}; const LvTimer = opaque {};
//const LvTimerCallback = *const fn (timer: *LvTimer) callconv(.C) void; // stage2 const LvTimerCallback = *const fn (timer: *LvTimer) callconv(.C) void;
const LvTimerCallback = fn (timer: *LvTimer) callconv(.C) void;
extern "c" fn lv_timer_create(callback: LvTimerCallback, period_ms: u32, userdata: ?*anyopaque) *LvTimer; extern "c" fn lv_timer_create(callback: LvTimerCallback, period_ms: u32, userdata: ?*anyopaque) *LvTimer;
extern "c" fn lv_timer_del(timer: *LvTimer) void; extern "c" fn lv_timer_del(timer: *LvTimer) void;
extern "c" fn lv_timer_set_repeat_count(timer: *LvTimer, n: i32) void; extern "c" fn lv_timer_set_repeat_count(timer: *LvTimer, n: i32) void;