Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/core/stdc/assert_.d
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ else version (CRuntime_Glibc)
///
void __assert_perror_fail(int errnum, const(char)* file, uint line, const(char)* func);
}
else version (CRuntime_Bionic)
{
void __assert(const(char)* __file, int __line, const(char)* __msg);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kinke, need this for the final 1.6 release to build for Android, don't know if ldc itself needs to be patched in any way to call this __assert with the right arguments for betterC.

Copy link
Contributor

@kinke kinke Nov 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does need to be patched as it currently assumes the Glibc signature on Linux. Can't believe they opted for shuffling around the args.

}
else
{
static assert(0);
Expand Down
14 changes: 3 additions & 11 deletions src/core/stdc/errno.d
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ else version (FreeBSD)
alias errno = __error;
}
}
else version (linux)
else version (CRuntime_Bionic)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linux refers to kernel APIs, but I don't see errno declarations in anywhere other than libc headers.

{
extern (C)
{
ref int __errno_location();
alias errno = __errno_location;
ref int __errno();
alias errno = __errno;
}
}
else version (Darwin)
Expand All @@ -75,14 +75,6 @@ else version (Darwin)
alias errno = __error;
}
}
else version (OSX)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Darwin block right before means this block will never be called.

{
extern (C)
{
ref int __error();
alias errno = __error;
}
}
else
{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I noticed is if I tried to go back to this old default block by making sure none of the above versions hit, I got an error in core.memory here about "errno is not an lvalue", so it appears #1917 can't be used with this default block anymore.

///
Expand Down