This fixes the name of fds_bits on FreeBSD - or actually, on all of the
BSDs listed in select.d. The way that they're declared in C is with a
member named __fds_bits and then a #define for fds_bits. The D
declarations managed to copy the struct declarations with the __ name
but didn't add aliases to correspond to the #defines.
The standard name is fds_bits and is what any user code should be using,
so I don't see any reason to have the __ versions other than to avoid
breaking any code that used the __ versions, because that's what was
there. So, I fixed the names and added deprecated aliases for the old
ones.
You can see the correct declaration for ifaddrs on Linux here:
https://www.man7.org/linux/man-pages/man3/getifaddrs.3.html
What the fields are supposed to be named is ifa_broadaddr and
ifa_dstaddr. However, because Linux defines them using a union, it gives
them different names within the union - ifu_broadaddr and ifu_dstaddr -
and then #defines the proper names to access the union names.
What druntime did was use the union names - and then incorrectly name
ifu_dtsaddr as if_dstaddr. So, it was doubly wrong for that field.
The two approaches that we could take here would be to either
1. Turn the union into a type so that we could have an ifa_ifu field to
allow accessing the ifu_* names that way - as is technically possible
in C - and then add wrapper functions with the ifa_* names (since we
couldn't use an alias to access members of the union member
variable).
2. Just rename the fields to ifa_* and ignore the fact that you can
technically access the ifu_* fields via the union name in C.
The simpler approach is #2, so that's what this commit does. I'm pretty
sure that the ability to access the ifu_* fields via the union name is
just an implementation detail - particularly since other platforms just
declare the ifa_* names without using a union at all.
Either way, deprecated aliases are provided so that existing code
doesn't break.
It's already declared in core.sys.posix.sys.socket, so declaring it in
core.sys.linux.sys.socket causes a conflict in code that imports both.
The Linux-specific module publicly imports the POSIX one, so the
declaration in the Linux one is unnecessary. This removes it.
FreeBSD #defines ifa_broadaddr to be ifa_dstaddr, and I missed it when
adding it to druntime. So, this adds the appropriate alias.
It does feel a bit weird to list the alias before the field that it's
aliasing, but that's the order presented in the man page, so it's what I
did.
The issue is caused by compiling druntime/phobos and the application
with different flags. The template instance for __switch_errorT is not
included in the build of druntime/phobos, because they are compiled
with -release. DMD will also not include it in an application compiled
without -release, because it assumes, that it is already in druntime.
See comment https://issues.dlang.org/show_bug.cgi?id=20802#c3 by Spoov.
The template instance for __switch_errorT is now always instantiated in
druntime, so it is part of the ABI of druntime.
Adds "Unsupported platform" static asserts
Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
druntime: Prepare `test/shared` for Windows support
Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Signed-off-by: Rainer Schuetze <rainers@users.noreply.github.com>
Merged-on-behalf-of: Martin Kinkelin <kinke@users.noreply.github.com>
The GNU built-in __atomic_is_lock_free either returns 'true' (always
lock free) or 'null' (meaning defer to run-time). So when the type isn't
always lock free - eg: 64-bit types on PPC - a compile-time error occurs
as we have no way of evaluating the run-time implementation of
libatomics at CTFE.
This has been fixed by checking `__traits(compiles)` instead.
demangle: minor changes for clarity
Signed-off-by: Dennis <dkorpel@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
fiber: Fixes mem allocation call status code ambiguity
Signed-off-by: Razvan Nitu <razvan.nitu1305@gmail.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
- Only use the `pure nothrow` wrapper `_d_newarrayUPureNothrow` for the
`pure nothrow` `_dup`
- Unqualify the template type given to `_d_newarrayU`. The initial
template was relying on this unqualification being done by the compiler,
but now it's called from `_dup`
- Fix `TypeInfoSize` to only account for type `struct`s
- Cannot remove `_d_newarray{iT,T,U}` from `rt.lifetime` because they're used by `aaA.d`
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>