Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Private Function

findNativeMsvcIncludeDir

Private Function
std.zig.LibCInstallation.findNativeMsvcIncludeDir
fn findNativeMsvcIncludeDir(
    self: *LibCInstallation,
    gpa: Allocator,
    io: Io,
    sdk: std.zig.WindowsSdk,
) FindError!void

Params

Errors

OutOfMemory
FileSystem
UnableToSpawnCCompiler
CCompilerExitCode
CCompilerCrashed
CCompilerCannotFindHeaders
LibCRuntimeNotFound
LibCStdLibHeaderNotFound
LibCKernel32LibNotFound
UnsupportedArchitecture
WindowsSdkNotFound
DarwinSdkNotFound
ZigIsTheCCompiler

File

zig/LibCInstallation.zig:524
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
fn findNativeMsvcIncludeDir(
    self: *LibCInstallation,
    gpa: Allocator,
    io: Io,
    sdk: std.zig.WindowsSdk,
) FindError!void {
    const msvc_lib_dir = sdk.msvc_lib_dir orelse return error.LibCStdLibHeaderNotFound;
    const up1 = fs.path.dirname(msvc_lib_dir) orelse return error.LibCStdLibHeaderNotFound;
    const up2 = fs.path.dirname(up1) orelse return error.LibCStdLibHeaderNotFound;

    const dir_path = try fs.path.join(gpa, &[_][]const u8{ up2, "include" });
    errdefer gpa.free(dir_path);

    var dir = Io.Dir.cwd().openDir(io, dir_path, .{}) catch |err| switch (err) {
        error.FileNotFound,
        error.NotDir,
        error.NoDevice,
        => return error.LibCStdLibHeaderNotFound,

        else => return error.FileSystem,
    };
    defer dir.close(io);

    dir.access(io, "vcruntime.h", .{}) catch |err| switch (err) {
        error.FileNotFound => return error.LibCStdLibHeaderNotFound,
        else => return error.FileSystem,
    };

    self.sys_include_dir = dir_path;
}