@@ -2,6 +2,7 @@ const std = @import("std");
22const builtin = @import ("builtin" );
33const microzig = @import ("microzig" );
44const app = @import ("app" );
5+ const failing = @import ("failing.zig" );
56
67// Use microzig panic handler if not defined by an application
78pub const panic = if (! @hasDecl (app , "panic" )) microzig .panic else app .panic ;
@@ -16,7 +17,7 @@ pub const std_options: std.Options = .{
1617 .logFn = microzig .options .logFn ,
1718};
1819
19- pub const std_options_debug_io : std.Io = nop () ;
20+ pub const std_options_debug_io : std.Io = failing . io ;
2021
2122// Startup logic:
2223comptime {
@@ -95,142 +96,3 @@ export fn microzig_main() noreturn {
9596 // Main returned, just hang around here a bit.
9697 microzig .hang ();
9798}
98-
99- fn nop () std.Io {
100- return .{
101- .userdata = null ,
102- .vtable = &.{
103- .async = async ,
104- .concurrent = concurrent ,
105- .await = await ,
106- .cancel = cancel ,
107- .select = select ,
108-
109- .groupAsync = groupAsync ,
110- .groupConcurrent = groupConcurrent ,
111- .groupAwait = groupAwait ,
112- .groupCancel = groupCancel ,
113-
114- .recancel = recancel ,
115- .swapCancelProtection = swapCancelProtection ,
116- .checkCancel = checkCancel ,
117-
118- .futexWait = futexWait ,
119- .futexWaitUncancelable = futexWaitUncancelable ,
120- .futexWake = futexWake ,
121-
122- .dirCreateDir = dirCreateDir ,
123- .dirCreateDirPath = dirCreateDirPath ,
124- .dirCreateDirPathOpen = dirCreateDirPathOpen ,
125- .dirStat = dirStat ,
126- .dirStatFile = dirStatFile ,
127- .dirAccess = dirAccess ,
128- .dirCreateFile = dirCreateFile ,
129- .dirCreateFileAtomic = dirCreateFileAtomic ,
130- .dirOpenFile = dirOpenFile ,
131- .dirOpenDir = dirOpenDir ,
132- .dirClose = dirClose ,
133- .dirRead = dirRead ,
134- .dirRealPath = dirRealPath ,
135- .dirRealPathFile = dirRealPathFile ,
136- .dirDeleteFile = dirDeleteFile ,
137- .dirDeleteDir = dirDeleteDir ,
138- .dirRename = dirRename ,
139- .dirRenamePreserve = dirRenamePreserve ,
140- .dirSymLink = dirSymLink ,
141- .dirReadLink = dirReadLink ,
142- .dirSetOwner = dirSetOwner ,
143- .dirSetFileOwner = dirSetFileOwner ,
144- .dirSetPermissions = dirSetPermissions ,
145- .dirSetFilePermissions = dirSetFilePermissions ,
146- .dirSetTimestamps = dirSetTimestamps ,
147- .dirHardLink = dirHardLink ,
148-
149- .fileStat = fileStat ,
150- .fileLength = fileLength ,
151- .fileClose = fileClose ,
152- .fileWriteStreaming = fileWriteStreaming ,
153- .fileWritePositional = fileWritePositional ,
154- .fileWriteFileStreaming = fileWriteFileStreaming ,
155- .fileWriteFilePositional = fileWriteFilePositional ,
156- .fileReadStreaming = fileReadStreaming ,
157- .fileReadPositional = fileReadPositional ,
158- .fileSeekBy = fileSeekBy ,
159- .fileSeekTo = fileSeekTo ,
160- .fileSync = fileSync ,
161- .fileIsTty = fileIsTty ,
162- .fileEnableAnsiEscapeCodes = fileEnableAnsiEscapeCodes ,
163- .fileSupportsAnsiEscapeCodes = fileSupportsAnsiEscapeCodes ,
164- .fileSetLength = fileSetLength ,
165- .fileSetOwner = fileSetOwner ,
166- .fileSetPermissions = fileSetPermissions ,
167- .fileSetTimestamps = fileSetTimestamps ,
168- .fileLock = fileLock ,
169- .fileTryLock = fileTryLock ,
170- .fileUnlock = fileUnlock ,
171- .fileDowngradeLock = fileDowngradeLock ,
172- .fileRealPath = fileRealPath ,
173- .fileHardLink = fileHardLink ,
174-
175- .processExecutableOpen = processExecutableOpen ,
176- .processExecutablePath = processExecutablePath ,
177- .lockStderr = lockStderr ,
178- .tryLockStderr = tryLockStderr ,
179- .unlockStderr = unlockStderr ,
180- .processSetCurrentDir = processSetCurrentDir ,
181- .processReplace = processReplace ,
182- .processReplacePath = processReplacePath ,
183- .processSpawn = processSpawn ,
184- .processSpawnPath = processSpawnPath ,
185- .childWait = childWait ,
186- .childKill = childKill ,
187-
188- .progressParentFile = progressParentFile ,
189-
190- .now = now ,
191- .sleep = sleep ,
192-
193- .random = random ,
194- .randomSecure = randomSecure ,
195-
196- .netListenIp = netListenIpUnavailable ,
197- .netListenUnix = netListenUnixUnavailable ,
198- .netAccept = netAcceptUnavailable ,
199- .netBindIp = netBindIpUnavailable ,
200- .netConnectIp = netConnectIpUnavailable ,
201- .netConnectUnix = netConnectUnixUnavailable ,
202- .netClose = netCloseUnavailable ,
203- .netShutdown = netShutdownUnavailable ,
204- .netRead = netReadUnavailable ,
205- .netWrite = netWriteUnavailable ,
206- .netWriteFile = netWriteFileUnavailable ,
207- .netSend = netSendUnavailable ,
208- .netReceive = netReceiveUnavailable ,
209- .netInterfaceNameResolve = netInterfaceNameResolveUnavailable ,
210- .netInterfaceName = netInterfaceNameUnavailable ,
211- .netLookup = netLookupUnavailable ,
212- },
213- };
214- }
215-
216- fn async (
217- _ : ? * anyopaque ,
218- _ : []u8 ,
219- _ : std.Alignment ,
220- _ : []const u8 ,
221- _ : std.Alignment ,
222- _ : * const fn (context : * const anyopaque , result : * anyopaque ) void ,
223- ) ? * std.Io.AnyFuture {
224- return null ;
225- }
226-
227- fn concurrent (
228- _ : ? * anyopaque ,
229- _ : usize ,
230- _ : std.mem.Alignment ,
231- _ : []const u8 ,
232- _ : std.mem.Alignment ,
233- _ : * const fn (context : * const anyopaque , result : * anyopaque ) void ,
234- ) std.Io.ConcurrentError ! * std.Io.AnyFuture {
235- return error .ConcurrencyUnavailable ;
236- }
0 commit comments