* Delete `std.net.TmpWinAddr`. I don't think that was ever meant to
be a real thing.
* Delete `std.net.OsAddress`. This abstraction was not helpful.
* Rename `std.net.Address` to `std.net.IpAddress`. It is now an extern
union of IPv4 and IPv6 addresses.
* Move `std.net.parseIp4` and `std.net.parseIp6` to the
`std.net.IpAddress` namespace. They now return `IpAddress` instead of
`u32` and `std.net.Ip6Addr`, which is deleted.
* Add `std.net.IpAddress.parse` which accepts a port and parses either
an IPv4 or IPv6 address.
* Add `std.net.IpAddress.parseExpectingFamily` which additionally
accepts a `family` parameter.
* `std.net.IpAddress.initIp4` and `std.net.IpAddress.initIp6` are
improved to directly take the address fields instead of a weird
in-between type.
* `std.net.IpAddress.port` is renamed to `std.net.IpAddress.getPort`.
* Added `std.net.IpAddress.setPort`.
* `os.sockaddr` struct on all targets is improved to match the
corresponding system struct. Previously I had made it a union of
sockaddr_in, sockaddr_in6, and sockaddr_un. The new abstraction for
this is now `std.net.IpAddress`.
* `os.sockaddr` and related bits are added for Windows.
* `os.sockaddr` and related bits now have the `zero` fields default
to zero initialization, and `len` fields default to the correct size.
This is enough to abstract the differences across targets, and so
no more switch on the target OS is needed in `std.net.IpAddress`.
* Add the missing `os.sockaddr_un` on FreeBSD and NetBSD.
* `std.net.IpAddress.initPosix` now takes a pointer to `os.sockaddr`.
* All the data types from `@import("builtin")` are moved to
`@import("std").builtin`. The target-related types are moved
to `std.Target`. This allows the data types to have methods, such as
`std.Target.current.isDarwin()`.
* `std.os.windows.subsystem` is moved to
`std.Target.current.subsystem`.
* Remove the concept of the panic package from the compiler
implementation. Instead, `std.builtin.panic` is always the panic
function. It checks for `@hasDecl(@import("root"), "panic")`,
or else provides a default implementation.
This is an important step for multibuilds (#3028). Without this change,
the types inside the builtin namespace look like different types, when
trying to merge builds with different target settings. With this change,
Zig can figure out that, e.g., `std.builtin.Os` (the enum type) from one
compilation and `std.builtin.Os` from another compilation are the same
type, even if the target OS value differs.
* use erase rest of line escape code.
* use `stderr.supportsAnsiEscapeCodes` rather than `isTty`.
* respect `--color off`
* avoid unnecessary recursion
* add `Progress.log`
* disable the progress std lib test since it's noisy and uses
`time.sleep()`.
* enable/integrate progress printing with the default test runner
`ir_resolve_str()` bug returns array expression even when when sliced
to a lesser length. Fix is to return array if slice.len == array.len,
otherwise return slice.
Bug report use-case is based on one builtin function. However, at least
the following builtins were exposed to the bug:
`@byteOffsetOf`
`@cDefine`
`@cImport`
`@cInclude`
`@cUndef`
`@compileError`
`@embedFile`
`@export`
`@fieldParentPtr`
`@hasDecl`
`@hasField`
`@import`
`@unionInit`
closes#3384
- during diagnostics the string representation for root was empty
and now is `(root)`
- retrofitted all other namespace-qualified type naming to elide
prefixing with root
closes#2032
- decls brought in via `usingnamespace` were not always found
because lookup was performed directly against decl_table and
use_decls was never consulted
- fix to use find_container_decl() path instead
- closes#3367
* fix libc prototypes of offsets to have correct integer sizes and
signedness. This gets all behavior tests to pass for
armv8-linux-musleabihf
* fix linux mmap syscall to have correct integer size and signedness
for offset
* disable failing armv8-linux-musleabihf std lib tests. See 3289. I
suspect compiler-rt issue. Note these tests fail with this target
triple regardless of whether musl is actually linked (-lc).