| ... | ... | @@ -5474,425 +5474,7 @@ const separator = if (builtin.os == builtin.Os.windows) '\\' else '/'; |
| 5474 | 5474 | <p> |
| 5475 | 5475 | Example of what is imported with <code>@import("builtin")</code>: |
| 5476 | 5476 | </p> |
| 5477 | | {#code_begin|syntax#} |
| 5478 | | pub const StackTrace = struct { |
| 5479 | | index: usize, |
| 5480 | | instruction_addresses: []usize, |
| 5481 | | }; |
| 5482 | | |
| 5483 | | pub const Os = enum { |
| 5484 | | freestanding, |
| 5485 | | ananas, |
| 5486 | | cloudabi, |
| 5487 | | dragonfly, |
| 5488 | | freebsd, |
| 5489 | | fuchsia, |
| 5490 | | ios, |
| 5491 | | kfreebsd, |
| 5492 | | linux, |
| 5493 | | lv2, |
| 5494 | | macosx, |
| 5495 | | netbsd, |
| 5496 | | openbsd, |
| 5497 | | solaris, |
| 5498 | | windows, |
| 5499 | | haiku, |
| 5500 | | minix, |
| 5501 | | rtems, |
| 5502 | | nacl, |
| 5503 | | cnk, |
| 5504 | | aix, |
| 5505 | | cuda, |
| 5506 | | nvcl, |
| 5507 | | amdhsa, |
| 5508 | | ps4, |
| 5509 | | elfiamcu, |
| 5510 | | tvos, |
| 5511 | | watchos, |
| 5512 | | mesa3d, |
| 5513 | | contiki, |
| 5514 | | amdpal, |
| 5515 | | zen, |
| 5516 | | }; |
| 5517 | | |
| 5518 | | pub const Arch = enum { |
| 5519 | | armv8_3a, |
| 5520 | | armv8_2a, |
| 5521 | | armv8_1a, |
| 5522 | | armv8, |
| 5523 | | armv8r, |
| 5524 | | armv8m_baseline, |
| 5525 | | armv8m_mainline, |
| 5526 | | armv7, |
| 5527 | | armv7em, |
| 5528 | | armv7m, |
| 5529 | | armv7s, |
| 5530 | | armv7k, |
| 5531 | | armv7ve, |
| 5532 | | armv6, |
| 5533 | | armv6m, |
| 5534 | | armv6k, |
| 5535 | | armv6t2, |
| 5536 | | armv5, |
| 5537 | | armv5te, |
| 5538 | | armv4t, |
| 5539 | | armebv8_3a, |
| 5540 | | armebv8_2a, |
| 5541 | | armebv8_1a, |
| 5542 | | armebv8, |
| 5543 | | armebv8r, |
| 5544 | | armebv8m_baseline, |
| 5545 | | armebv8m_mainline, |
| 5546 | | armebv7, |
| 5547 | | armebv7em, |
| 5548 | | armebv7m, |
| 5549 | | armebv7s, |
| 5550 | | armebv7k, |
| 5551 | | armebv7ve, |
| 5552 | | armebv6, |
| 5553 | | armebv6m, |
| 5554 | | armebv6k, |
| 5555 | | armebv6t2, |
| 5556 | | armebv5, |
| 5557 | | armebv5te, |
| 5558 | | armebv4t, |
| 5559 | | aarch64, |
| 5560 | | aarch64_be, |
| 5561 | | arc, |
| 5562 | | avr, |
| 5563 | | bpfel, |
| 5564 | | bpfeb, |
| 5565 | | hexagon, |
| 5566 | | mips, |
| 5567 | | mipsel, |
| 5568 | | mips64, |
| 5569 | | mips64el, |
| 5570 | | msp430, |
| 5571 | | nios2, |
| 5572 | | powerpc, |
| 5573 | | powerpc64, |
| 5574 | | powerpc64le, |
| 5575 | | r600, |
| 5576 | | amdgcn, |
| 5577 | | riscv32, |
| 5578 | | riscv64, |
| 5579 | | sparc, |
| 5580 | | sparcv9, |
| 5581 | | sparcel, |
| 5582 | | s390x, |
| 5583 | | tce, |
| 5584 | | tcele, |
| 5585 | | thumb, |
| 5586 | | thumbeb, |
| 5587 | | i386, |
| 5588 | | x86_64, |
| 5589 | | xcore, |
| 5590 | | nvptx, |
| 5591 | | nvptx64, |
| 5592 | | le32, |
| 5593 | | le64, |
| 5594 | | amdil, |
| 5595 | | amdil64, |
| 5596 | | hsail, |
| 5597 | | hsail64, |
| 5598 | | spir, |
| 5599 | | spir64, |
| 5600 | | kalimbav3, |
| 5601 | | kalimbav4, |
| 5602 | | kalimbav5, |
| 5603 | | shave, |
| 5604 | | lanai, |
| 5605 | | wasm32, |
| 5606 | | wasm64, |
| 5607 | | renderscript32, |
| 5608 | | renderscript64, |
| 5609 | | }; |
| 5610 | | |
| 5611 | | pub const Environ = enum { |
| 5612 | | unknown, |
| 5613 | | gnu, |
| 5614 | | gnuabin32, |
| 5615 | | gnuabi64, |
| 5616 | | gnueabi, |
| 5617 | | gnueabihf, |
| 5618 | | gnux32, |
| 5619 | | code16, |
| 5620 | | eabi, |
| 5621 | | eabihf, |
| 5622 | | android, |
| 5623 | | musl, |
| 5624 | | musleabi, |
| 5625 | | musleabihf, |
| 5626 | | msvc, |
| 5627 | | itanium, |
| 5628 | | cygnus, |
| 5629 | | amdopencl, |
| 5630 | | coreclr, |
| 5631 | | opencl, |
| 5632 | | simulator, |
| 5633 | | }; |
| 5634 | | |
| 5635 | | pub const ObjectFormat = enum { |
| 5636 | | unknown, |
| 5637 | | coff, |
| 5638 | | elf, |
| 5639 | | macho, |
| 5640 | | wasm, |
| 5641 | | }; |
| 5642 | | |
| 5643 | | pub const GlobalLinkage = enum { |
| 5644 | | Internal, |
| 5645 | | Strong, |
| 5646 | | Weak, |
| 5647 | | LinkOnce, |
| 5648 | | }; |
| 5649 | | |
| 5650 | | pub const AtomicOrder = enum { |
| 5651 | | Unordered, |
| 5652 | | Monotonic, |
| 5653 | | Acquire, |
| 5654 | | Release, |
| 5655 | | AcqRel, |
| 5656 | | SeqCst, |
| 5657 | | }; |
| 5658 | | |
| 5659 | | pub const AtomicRmwOp = enum { |
| 5660 | | Xchg, |
| 5661 | | Add, |
| 5662 | | Sub, |
| 5663 | | And, |
| 5664 | | Nand, |
| 5665 | | Or, |
| 5666 | | Xor, |
| 5667 | | Max, |
| 5668 | | Min, |
| 5669 | | }; |
| 5670 | | |
| 5671 | | pub const Mode = enum { |
| 5672 | | Debug, |
| 5673 | | ReleaseSafe, |
| 5674 | | ReleaseFast, |
| 5675 | | ReleaseSmall, |
| 5676 | | }; |
| 5677 | | |
| 5678 | | pub const TypeId = enum { |
| 5679 | | Type, |
| 5680 | | Void, |
| 5681 | | Bool, |
| 5682 | | NoReturn, |
| 5683 | | Int, |
| 5684 | | Float, |
| 5685 | | Pointer, |
| 5686 | | Array, |
| 5687 | | Struct, |
| 5688 | | ComptimeFloat, |
| 5689 | | ComptimeInt, |
| 5690 | | Undefined, |
| 5691 | | Null, |
| 5692 | | Nullable, |
| 5693 | | ErrorUnion, |
| 5694 | | ErrorSet, |
| 5695 | | Enum, |
| 5696 | | Union, |
| 5697 | | Fn, |
| 5698 | | Namespace, |
| 5699 | | Block, |
| 5700 | | BoundFn, |
| 5701 | | ArgTuple, |
| 5702 | | Opaque, |
| 5703 | | Promise, |
| 5704 | | }; |
| 5705 | | |
| 5706 | | pub const TypeInfo = union(TypeId) { |
| 5707 | | Type: void, |
| 5708 | | Void: void, |
| 5709 | | Bool: void, |
| 5710 | | NoReturn: void, |
| 5711 | | Int: Int, |
| 5712 | | Float: Float, |
| 5713 | | Pointer: Pointer, |
| 5714 | | Array: Array, |
| 5715 | | Struct: Struct, |
| 5716 | | ComptimeFloat: void, |
| 5717 | | ComptimeInt: void, |
| 5718 | | Undefined: void, |
| 5719 | | Null: void, |
| 5720 | | Nullable: Nullable, |
| 5721 | | ErrorUnion: ErrorUnion, |
| 5722 | | ErrorSet: ErrorSet, |
| 5723 | | Enum: Enum, |
| 5724 | | Union: Union, |
| 5725 | | Fn: Fn, |
| 5726 | | Namespace: void, |
| 5727 | | Block: void, |
| 5728 | | BoundFn: Fn, |
| 5729 | | ArgTuple: void, |
| 5730 | | Opaque: void, |
| 5731 | | Promise: Promise, |
| 5732 | | |
| 5733 | | |
| 5734 | | pub const Int = struct { |
| 5735 | | is_signed: bool, |
| 5736 | | bits: u8, |
| 5737 | | }; |
| 5738 | | |
| 5739 | | pub const Float = struct { |
| 5740 | | bits: u8, |
| 5741 | | }; |
| 5742 | | |
| 5743 | | pub const Pointer = struct { |
| 5744 | | is_const: bool, |
| 5745 | | is_volatile: bool, |
| 5746 | | alignment: u32, |
| 5747 | | child: type, |
| 5748 | | }; |
| 5749 | | |
| 5750 | | pub const Array = struct { |
| 5751 | | len: usize, |
| 5752 | | child: type, |
| 5753 | | }; |
| 5754 | | |
| 5755 | | pub const ContainerLayout = enum { |
| 5756 | | Auto, |
| 5757 | | Extern, |
| 5758 | | Packed, |
| 5759 | | }; |
| 5760 | | |
| 5761 | | pub const StructField = struct { |
| 5762 | | name: []const u8, |
| 5763 | | offset: ?usize, |
| 5764 | | field_type: type, |
| 5765 | | }; |
| 5766 | | |
| 5767 | | pub const Struct = struct { |
| 5768 | | layout: ContainerLayout, |
| 5769 | | fields: []StructField, |
| 5770 | | defs: []Definition, |
| 5771 | | }; |
| 5772 | | |
| 5773 | | pub const Nullable = struct { |
| 5774 | | child: type, |
| 5775 | | }; |
| 5776 | | |
| 5777 | | pub const ErrorUnion = struct { |
| 5778 | | error_set: type, |
| 5779 | | payload: type, |
| 5780 | | }; |
| 5781 | | |
| 5782 | | pub const Error = struct { |
| 5783 | | name: []const u8, |
| 5784 | | value: usize, |
| 5785 | | }; |
| 5786 | | |
| 5787 | | pub const ErrorSet = struct { |
| 5788 | | errors: []Error, |
| 5789 | | }; |
| 5790 | | |
| 5791 | | pub const EnumField = struct { |
| 5792 | | name: []const u8, |
| 5793 | | value: usize, |
| 5794 | | }; |
| 5795 | | |
| 5796 | | pub const Enum = struct { |
| 5797 | | layout: ContainerLayout, |
| 5798 | | tag_type: type, |
| 5799 | | fields: []EnumField, |
| 5800 | | defs: []Definition, |
| 5801 | | }; |
| 5802 | | |
| 5803 | | pub const UnionField = struct { |
| 5804 | | name: []const u8, |
| 5805 | | enum_field: ?EnumField, |
| 5806 | | field_type: type, |
| 5807 | | }; |
| 5808 | | |
| 5809 | | pub const Union = struct { |
| 5810 | | layout: ContainerLayout, |
| 5811 | | tag_type: type, |
| 5812 | | fields: []UnionField, |
| 5813 | | defs: []Definition, |
| 5814 | | }; |
| 5815 | | |
| 5816 | | pub const CallingConvention = enum { |
| 5817 | | Unspecified, |
| 5818 | | C, |
| 5819 | | Cold, |
| 5820 | | Naked, |
| 5821 | | Stdcall, |
| 5822 | | Async, |
| 5823 | | }; |
| 5824 | | |
| 5825 | | pub const FnArg = struct { |
| 5826 | | is_generic: bool, |
| 5827 | | is_noalias: bool, |
| 5828 | | arg_type: type, |
| 5829 | | }; |
| 5830 | | |
| 5831 | | pub const Fn = struct { |
| 5832 | | calling_convention: CallingConvention, |
| 5833 | | is_generic: bool, |
| 5834 | | is_var_args: bool, |
| 5835 | | return_type: type, |
| 5836 | | async_allocator_type: type, |
| 5837 | | args: []FnArg, |
| 5838 | | }; |
| 5839 | | |
| 5840 | | pub const Promise = struct { |
| 5841 | | child: type, |
| 5842 | | }; |
| 5843 | | |
| 5844 | | pub const Definition = struct { |
| 5845 | | name: []const u8, |
| 5846 | | is_pub: bool, |
| 5847 | | data: Data, |
| 5848 | | |
| 5849 | | pub const Data = union(enum) { |
| 5850 | | Type: type, |
| 5851 | | Var: type, |
| 5852 | | Fn: FnDef, |
| 5853 | | |
| 5854 | | pub const FnDef = struct { |
| 5855 | | fn_type: type, |
| 5856 | | inline_type: Inline, |
| 5857 | | calling_convention: CallingConvention, |
| 5858 | | is_var_args: bool, |
| 5859 | | is_extern: bool, |
| 5860 | | is_export: bool, |
| 5861 | | lib_name: ?[]const u8, |
| 5862 | | return_type: type, |
| 5863 | | arg_names: [][] const u8, |
| 5864 | | |
| 5865 | | pub const Inline = enum { |
| 5866 | | Auto, |
| 5867 | | Always, |
| 5868 | | Never, |
| 5869 | | }; |
| 5870 | | }; |
| 5871 | | }; |
| 5872 | | }; |
| 5873 | | }; |
| 5874 | | |
| 5875 | | pub const FloatMode = enum { |
| 5876 | | Optimized, |
| 5877 | | Strict, |
| 5878 | | }; |
| 5879 | | |
| 5880 | | pub const Endian = enum { |
| 5881 | | Big, |
| 5882 | | Little, |
| 5883 | | }; |
| 5884 | | |
| 5885 | | pub const endian = Endian.Little; |
| 5886 | | pub const is_test = true; |
| 5887 | | pub const os = Os.linux; |
| 5888 | | pub const arch = Arch.x86_64; |
| 5889 | | pub const environ = Environ.gnu; |
| 5890 | | pub const object_format = ObjectFormat.elf; |
| 5891 | | pub const mode = Mode.Debug; |
| 5892 | | pub const link_libc = false; |
| 5893 | | pub const have_error_return_tracing = true; |
| 5894 | | pub const __zig_test_fn_slice = {}; // overwritten later |
| 5895 | | {#code_end#} |
| 5477 | {#builtin#} |
| 5896 | 5478 | {#see_also|Build Mode#} |
| 5897 | 5479 | {#header_close#} |
| 5898 | 5480 | {#header_open|Root Source File#} |
| ... | ... | @@ -6053,8 +5635,7 @@ pub fn build(b: *Builder) void { |
| 6053 | 5635 | b.default_step.dependOn(&exe.step); |
| 6054 | 5636 | } |
| 6055 | 5637 | {#code_end#} |
| 6056 | | {#header_close#} |
| 6057 | | {#header_open|Terminal#} |
| 5638 | <p class="file">terminal</p> |
| 6058 | 5639 | <pre><code class="shell">$ zig build |
| 6059 | 5640 | $ ./test |
| 6060 | 5641 | all your base are belong to us</code></pre> |