mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-19 10:05:05 -07:00
Zig 0.12 compat
This commit is contained in:
parent
d1a0b7e7cb
commit
426082ee25
14
build.zig
14
build.zig
@ -103,9 +103,17 @@ pub fn build(b: *std.build.Builder) !void {
|
||||
lib.defineCMacro("HAVE_TI_MODE", "1");
|
||||
|
||||
if (target.cpu_arch) |arch| {
|
||||
switch (arch.endian()) {
|
||||
.Big => lib.defineCMacro("NATIVE_BIG_ENDIAN", "1"),
|
||||
.Little => lib.defineCMacro("NATIVE_LITTLE_ENDIAN", "1"),
|
||||
const endian = arch.endian();
|
||||
if (@hasField(@TypeOf(endian), "big")) {
|
||||
switch (endian) {
|
||||
.big => lib.defineCMacro("NATIVE_BIG_ENDIAN", "1"),
|
||||
.little => lib.defineCMacro("NATIVE_LITTLE_ENDIAN", "1"),
|
||||
}
|
||||
} else {
|
||||
switch (endian) {
|
||||
.Big => lib.defineCMacro("NATIVE_BIG_ENDIAN", "1"),
|
||||
.Little => lib.defineCMacro("NATIVE_LITTLE_ENDIAN", "1"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user