Skip to content

Refactor term functions and update for Zig 0.17#3

Open
cers000 wants to merge 3 commits into
vExcess:mainfrom
cers000:main
Open

Refactor term functions and update for Zig 0.17#3
cers000 wants to merge 3 commits into
vExcess:mainfrom
cers000:main

Conversation

@cers000

@cers000 cers000 commented Jun 3, 2026

Copy link
Copy Markdown

主要是@cImport被移除了,通过addTranslateC自动转义生成的translate_c.zig并不好用,很多翻译的zig代码有问题,比如

pub const stdin = __acrt_iob_func(@as(c_int, 0));
pub const stdout = __acrt_iob_func(@as(c_int, 1));
pub const stderr = __acrt_iob_func(@as(c_int, 2));

这些代码在zig build的compile阶段过不了编译器,因为error: comptime call of extern function

cers000 added 3 commits June 3, 2026 22:39
使用简单的方式重构这两个函数让构建程序能够顺利运行

@cers000 cers000 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我仔细看了这些代码,没有问题,在Windows 10 64bit,zig 0.17.0-dev.657+2faf8debf,可以正常构建,生成了正常的.\zig-out\bin\mqjs.exe程序,并正常运行

@vExcess

vExcess commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Zig 0.17 is the master branch. It is unstable and constantly changing. So I'm not targeting it.

@vExcess vExcess closed this Jun 3, 2026
@cers000

cers000 commented Jun 4, 2026

Copy link
Copy Markdown
Author

Andrew Kelley自己说的几周内就会发布zig0.17,目前这个库仍有需要完善的地方,尤其是readline_tty.zig似乎可以摆脱c头文件引入,等这些完善了,zig0.17就已经发布了,正好可以承载新版本带了的构建速度优势。

Build System Reworked
Author: Andrew KelleyMay 26, 2026

If you’re someone who wants to influence the direction of Zig, this is a good time to upgrade your projects to the development version and try out these changes. We’ll be releasing 0.17.0 within a couple weeks from now. However, if you don’t have time, and you find out that 0.17.0 broke your build, don’t worry, there will be plenty of opportunity to get fixes in for the 0.17.1 tag as well.

@vExcess

vExcess commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Ok. Well I'm not going to merge this until 0.17 is released, but I guess I'll reopen the pull request until then

@vExcess vExcess reopened this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants