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. Public Function

requiresLibC

Public Function
std.Target.requiresLibC
pub fn requiresLibC(target: *const Target) bool

Does this target require linking libc? This may be the case if the target has an unstable syscall interface, for example.

Params

File

Target.zig:2290
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
pub fn requiresLibC(target: *const Target) bool {
    return switch (target.os.tag) {
        .illumos,
        .driverkit,
        .ios,
        .maccatalyst,
        .macos,
        .tvos,
        .watchos,
        .visionos,
        .dragonfly,
        .haiku,
        .serenity,
        .emscripten,
        => true,

        // Android API levels prior to 29 did not have native TLS support. For these API levels, TLS
        // is implemented through calls to `__emutls_get_address`. We provide this function in
        // compiler-rt, but it's implemented by way of `pthread_key_create` et al, so linking libc
        // is required.
        .linux => target.abi.isAndroid() and target.os.version_range.linux.android < 29,

        .windows,
        .freebsd,
        .netbsd,
        .openbsd,
        .freestanding,
        .fuchsia,
        .managarm,
        .rtems,
        .cuda,
        .nvcl,
        .amdhsa,
        .psx,
        .ps3,
        .ps4,
        .ps5,
        .gba,
        .psp,
        .vita,
        .mesa3d,
        .contiki,
        .amdpal,
        .hermit,
        .hurd,
        .wasi,
        .uefi,
        .opencl,
        .opengl,
        .vulkan,
        .plan9,
        .other,
        .@"3ds",
        .wiiu,
        .@"switch",
        .tios,
        .ashetos,
        => false,
    };
}