mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
std: correct getcontext for Android bionic libc
I have updated Felix's ZigAndroidTemplate to work with the latest version of Zig and we are exploring adding Android support to Mach engine. `std.c.getcontext` is _referenced_ but not _used_, and Android's bionic libc does not implement `getcontext`. `std.os.linux.getcontext` also cannot be used with bionic libc, so it seems prudent to just disable this extern for now. This may not be the perfect long-term fix, but I have a golden rebuttal to that: before I was unable to compile Zig applications for Android, and now I can. <img width="828" alt="image" src="https://github.com/hexops/mach/assets/3173176/1e29142b-0419-4459-9c8b-75d92f87f822"> Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
2651363c9d
commit
55f0d8b41c
@ -408,7 +408,11 @@ pub extern "c" fn setlogmask(maskpri: c_int) c_int;
|
|||||||
|
|
||||||
pub extern "c" fn if_nametoindex([*:0]const u8) c_int;
|
pub extern "c" fn if_nametoindex([*:0]const u8) c_int;
|
||||||
|
|
||||||
pub usingnamespace if (builtin.os.tag == .linux and builtin.target.isMusl()) struct {
|
pub usingnamespace if (builtin.target.isAndroid()) struct {
|
||||||
|
// android bionic libc does not implement getcontext,
|
||||||
|
// and std.os.linux.getcontext also cannot be built for
|
||||||
|
// bionic libc currently.
|
||||||
|
} else if (builtin.os.tag == .linux and builtin.target.isMusl()) struct {
|
||||||
// musl does not implement getcontext
|
// musl does not implement getcontext
|
||||||
pub const getcontext = std.os.linux.getcontext;
|
pub const getcontext = std.os.linux.getcontext;
|
||||||
} else struct {
|
} else struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user