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

default

Public Function
std.Target.Abi.default
pub fn default(arch: Cpu.Arch, os_tag: Os.Tag) Abi

Params

File

Target.zig:835
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
    pub fn default(arch: Cpu.Arch, os_tag: Os.Tag) Abi {
        return switch (os_tag) {
            .freestanding, .other => switch (arch) {
                // Soft float is usually a sane default for freestanding.
                .arm,
                .armeb,
                .csky,
                .hppa,
                .mips,
                .mipsel,
                .powerpc,
                .powerpcle,
                .sh,
                .sheb,
                .thumb,
                .thumbeb,
                => .eabi,
                else => .none,
            },
            .fuchsia => switch (arch) {
                .arm,
                .thumb,
                => .eabihf,
                else => .none,
            },
            .haiku => switch (arch) {
                .arm => .eabihf,
                else => .none,
            },
            .hurd => .gnu,
            .linux => switch (arch) {
                .arm,
                .armeb,
                .powerpc,
                .powerpcle,
                .thumb,
                .thumbeb,
                => .musleabihf,
                .mips,
                .mipsel,
                => .musleabi,
                .mips64,
                .mips64el,
                => .muslabi64,

                // No musl support.
                .alpha,
                .arc,
                .arceb,
                .or1k,
                .sparc,
                .sparc64,
                => .gnu,
                .csky,
                => .gnueabi,
                .hppa,
                .sh,
                .sheb,
                => .gnueabihf,

                // No glibc or musl support.
                .xtensa,
                .xtensaeb,
                => .none,

                else => .musl,
            },
            .rtems => switch (arch) {
                .arm,
                .armeb,
                .thumb,
                .thumbeb,
                .mips,
                .mipsel,
                => .eabi,
                .powerpc,
                => .eabihf,
                else => .none,
            },
            .freebsd => switch (arch) {
                .arm,
                => .eabihf,
                else => .none,
            },
            .netbsd => switch (arch) {
                .arm,
                .armeb,
                .powerpc,
                => .eabihf,
                // Soft float tends to be more common for MIPS.
                .mips,
                .mipsel,
                => .eabi,
                else => .none,
            },
            .openbsd => switch (arch) {
                .arm,
                => .eabi,
                .powerpc,
                => .eabihf,
                else => .none,
            },
            .windows => .gnu,
            .uefi => .msvc,
            .@"3ds" => .eabihf,
            .wiiu => .eabihf,
            .gba => .eabi,
            .psx => .eabi,
            .psp => .eabihf,
            .vita => .eabihf,
            .wasi, .emscripten => .musl,

            .ashetos => .eabi,

            .contiki,
            .hermit,
            .illumos,
            .managarm,
            .plan9,
            .serenity,
            .dragonfly,
            .driverkit,
            .ios,
            .maccatalyst,
            .macos,
            .tvos,
            .visionos,
            .watchos,
            .@"switch",
            .ps3,
            .ps4,
            .ps5,
            .amdhsa,
            .amdpal,
            .cuda,
            .mesa3d,
            .nvcl,
            .opencl,
            .opengl,
            .vulkan,
            .tios,
            => .none,
        };
    }