Skip to content

Commit

Permalink
Default zlib foreign import
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerBill committed Apr 5, 2023
1 parent 167b320 commit eef4442
Showing 1 changed file with 34 additions and 29 deletions.
63 changes: 34 additions & 29 deletions vendor/zlib/zlib.odin
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ package vendor_zlib

import "core:c"

when ODIN_OS == .Windows { foreign import zlib "libz.lib" }
when ODIN_OS == .Linux { foreign import zlib "system:z" }
when ODIN_OS == .Windows {
foreign import zlib "libz.lib"
} else when ODIN_OS == .Linux {
foreign import zlib "system:z"
} else {
foreign import zlib "system:z"
}

VERSION :: "1.2.12"
VERNUM :: 0x12c0
Expand Down Expand Up @@ -41,39 +46,39 @@ gzFile_s :: struct {
gzFile :: ^gzFile_s

z_stream_s :: struct {
next_in: ^Bytef,
avail_in: uInt,
total_in: uLong,
next_out: ^Bytef,
avail_out: uInt,
total_out: uLong,
msg: [^]c.char,
state: rawptr,
zalloc: alloc_func,
zfree: free_func,
opaque: voidpf,
data_type: c.int,
adler: uLong,
reserved: uLong,
next_in: ^Bytef,
avail_in: uInt,
total_in: uLong,
next_out: ^Bytef,
avail_out: uInt,
total_out: uLong,
msg: [^]c.char,
state: rawptr,
zalloc: alloc_func,
zfree: free_func,
opaque: voidpf,
data_type: c.int,
adler: uLong,
reserved: uLong,
}

z_stream :: z_stream_s
z_streamp :: ^z_stream

gz_header_s :: struct {
text: c.int,
time: uLong,
xflags: c.int,
os: c.int,
extra: [^]Bytef,
extra_len: uInt,
extra_max: uInt,
name: [^]Bytef,
name_max: uInt,
comment: [^]Bytef,
comm_max: uInt,
hcrc: c.int,
done: c.int,
text: c.int,
time: uLong,
xflags: c.int,
os: c.int,
extra: [^]Bytef,
extra_len: uInt,
extra_max: uInt,
name: [^]Bytef,
name_max: uInt,
comment: [^]Bytef,
comm_max: uInt,
hcrc: c.int,
done: c.int,
}

gz_header :: gz_header_s
Expand Down

0 comments on commit eef4442

Please sign in to comment.