Skip to content

Commit a81136e

Browse files
committed
Add patch for mutable buffer structs
1 parent 6976631 commit a81136e

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

src/libzstd/generator.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ headers = [joinpath(include_dir, header) for header in readdir(include_dir) if e
1818
ctx = create_context(headers, args, options)
1919

2020
# run generator
21-
build!(ctx)
21+
build!(ctx)
22+
run(`git apply libzstd_clang_generated.patch`)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git b/src/libzstd/LibZstd.jl a/src/libzstd/LibZstd.jl
2+
index f0a0e56..40d0489 100644
3+
--- b/src/libzstd/LibZstd.jl
4+
+++ a/src/libzstd/LibZstd.jl
5+
@@ -234,7 +234,7 @@ function ZSTD_DCtx_reset(dctx, reset)
6+
ccall((:ZSTD_DCtx_reset, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, ZSTD_ResetDirective), dctx, reset)
7+
end
8+
9+
-struct ZSTD_inBuffer_s
10+
+mutable struct ZSTD_inBuffer_s
11+
src::Ptr{Cvoid}
12+
size::Csize_t
13+
pos::Csize_t
14+
@@ -242,7 +242,7 @@ end
15+
16+
const ZSTD_inBuffer = ZSTD_inBuffer_s
17+
18+
-struct ZSTD_outBuffer_s
19+
+mutable struct ZSTD_outBuffer_s
20+
dst::Ptr{Cvoid}
21+
size::Csize_t
22+
pos::Csize_t
23+
@@ -1029,6 +1029,7 @@ const ZSTD_WINDOWLOG_MAX_32 = 30
24+
const ZSTD_WINDOWLOG_MAX_64 = 31
25+
26+
# Skipping MacroDefinition: ZSTD_WINDOWLOG_MAX ( ( int ) ( sizeof ( size_t ) == 4 ? ZSTD_WINDOWLOG_MAX_32 : ZSTD_WINDOWLOG_MAX_64 ) )
27+
+const ZSTD_WINDOWLOG_MAX = sizeof(Csize_t) == 4 ? ZSTD_WINDOWLOG_MAX_32 : ZSTD_WINDOWLOG_MAX_64
28+
29+
const ZSTD_WINDOWLOG_MIN = 10
30+

0 commit comments

Comments
 (0)