| ... | @@ -2324,6 +2324,7 @@ pub const TargetQuery = struct { | ... | @@ -2324,6 +2324,7 @@ pub const TargetQuery = struct { |
| 2324 | ps3, | 2324 | ps3, |
| 2325 | ps4, | 2325 | ps4, |
| 2326 | ps5, | 2326 | ps5, |
| | 2327 | psp, |
| 2327 | vita, | 2328 | vita, |
| 2328 | emscripten, | 2329 | emscripten, |
| 2329 | wasi, | 2330 | wasi, |
| ... | @@ -2335,18 +2336,105 @@ pub const TargetQuery = struct { | ... | @@ -2335,18 +2336,105 @@ pub const TargetQuery = struct { |
| 2335 | opencl, | 2336 | opencl, |
| 2336 | opengl, | 2337 | opengl, |
| 2337 | vulkan, | 2338 | vulkan, |
| | 2339 | tios, |
| 2338 | | 2340 | |
| 2339 | default, | 2341 | default, |
| 2340 | | 2342 | |
| 2341 | pub fn init(x: ?std.Target.Os.Tag) @This() { | 2343 | pub fn init(x: ?std.Target.Os.Tag) @This() { |
| 2342 | // TODO comptime assert the enums match | 2344 | return switch (x orelse return .default) { |
| 2343 | return @enumFromInt(@intFromEnum(x orelse return .default)); | 2345 | .freestanding => .freestanding, |
| | 2346 | .other => .other, |
| | 2347 | .contiki => .contiki, |
| | 2348 | .fuchsia => .fuchsia, |
| | 2349 | .hermit => .hermit, |
| | 2350 | .managarm => .managarm, |
| | 2351 | .haiku => .haiku, |
| | 2352 | .hurd => .hurd, |
| | 2353 | .illumos => .illumos, |
| | 2354 | .linux => .linux, |
| | 2355 | .plan9 => .plan9, |
| | 2356 | .rtems => .rtems, |
| | 2357 | .serenity => .serenity, |
| | 2358 | .dragonfly => .dragonfly, |
| | 2359 | .freebsd => .freebsd, |
| | 2360 | .netbsd => .netbsd, |
| | 2361 | .openbsd => .openbsd, |
| | 2362 | .driverkit => .driverkit, |
| | 2363 | .ios => .ios, |
| | 2364 | .maccatalyst => .maccatalyst, |
| | 2365 | .macos => .macos, |
| | 2366 | .tvos => .tvos, |
| | 2367 | .visionos => .visionos, |
| | 2368 | .watchos => .watchos, |
| | 2369 | .windows => .windows, |
| | 2370 | .uefi => .uefi, |
| | 2371 | .@"3ds" => .@"3ds", |
| | 2372 | .ps3 => .ps3, |
| | 2373 | .ps4 => .ps4, |
| | 2374 | .ps5 => .ps5, |
| | 2375 | .psp => .psp, |
| | 2376 | .vita => .vita, |
| | 2377 | .emscripten => .emscripten, |
| | 2378 | .wasi => .wasi, |
| | 2379 | .amdhsa => .amdhsa, |
| | 2380 | .amdpal => .amdpal, |
| | 2381 | .cuda => .cuda, |
| | 2382 | .mesa3d => .mesa3d, |
| | 2383 | .nvcl => .nvcl, |
| | 2384 | .opencl => .opencl, |
| | 2385 | .opengl => .opengl, |
| | 2386 | .vulkan => .vulkan, |
| | 2387 | .tios => .tios, |
| | 2388 | }; |
| 2344 | } | 2389 | } |
| 2345 | | 2390 | |
| 2346 | pub fn unwrap(this: @This()) ?std.Target.Os.Tag { | 2391 | pub fn unwrap(this: @This()) ?std.Target.Os.Tag { |
| 2347 | // TODO comptime assert the enums match | 2392 | return switch (this) { |
| 2348 | if (this == .default) return null; | 2393 | .default => null, |
| 2349 | return @enumFromInt(@intFromEnum(this)); | 2394 | .freestanding => .freestanding, |
| | 2395 | .other => .other, |
| | 2396 | .contiki => .contiki, |
| | 2397 | .fuchsia => .fuchsia, |
| | 2398 | .hermit => .hermit, |
| | 2399 | .managarm => .managarm, |
| | 2400 | .haiku => .haiku, |
| | 2401 | .hurd => .hurd, |
| | 2402 | .illumos => .illumos, |
| | 2403 | .linux => .linux, |
| | 2404 | .plan9 => .plan9, |
| | 2405 | .rtems => .rtems, |
| | 2406 | .serenity => .serenity, |
| | 2407 | .dragonfly => .dragonfly, |
| | 2408 | .freebsd => .freebsd, |
| | 2409 | .netbsd => .netbsd, |
| | 2410 | .openbsd => .openbsd, |
| | 2411 | .driverkit => .driverkit, |
| | 2412 | .ios => .ios, |
| | 2413 | .maccatalyst => .maccatalyst, |
| | 2414 | .macos => .macos, |
| | 2415 | .tvos => .tvos, |
| | 2416 | .visionos => .visionos, |
| | 2417 | .watchos => .watchos, |
| | 2418 | .windows => .windows, |
| | 2419 | .uefi => .uefi, |
| | 2420 | .@"3ds" => .@"3ds", |
| | 2421 | .ps3 => .ps3, |
| | 2422 | .ps4 => .ps4, |
| | 2423 | .ps5 => .ps5, |
| | 2424 | .psp => .psp, |
| | 2425 | .vita => .vita, |
| | 2426 | .emscripten => .emscripten, |
| | 2427 | .wasi => .wasi, |
| | 2428 | .amdhsa => .amdhsa, |
| | 2429 | .amdpal => .amdpal, |
| | 2430 | .cuda => .cuda, |
| | 2431 | .mesa3d => .mesa3d, |
| | 2432 | .nvcl => .nvcl, |
| | 2433 | .opencl => .opencl, |
| | 2434 | .opengl => .opengl, |
| | 2435 | .vulkan => .vulkan, |
| | 2436 | .tios => .tios, |
| | 2437 | }; |
| 2350 | } | 2438 | } |
| 2351 | }; | 2439 | }; |
| 2352 | pub const ObjectFormat = enum(u4) { | 2440 | pub const ObjectFormat = enum(u4) { |