-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbrotli_patch
64 lines (59 loc) · 1.9 KB
/
brotli_patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2dc7232..0d4b482 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -181,17 +181,8 @@ if(BROTLI_PARENT_DIRECTORY)
set(BROTLI_LIBRARIES "${BROTLI_LIBRARIES}" PARENT_SCOPE)
endif()
-# Build the brotli executable
-add_executable(brotli ${BROTLI_CLI_C})
-target_link_libraries(brotli ${BROTLI_LIBRARIES_STATIC})
-
# Installation
if(NOT BROTLI_BUNDLED_MODE)
- install(
- TARGETS brotli
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- )
-
install(
TARGETS ${BROTLI_LIBRARIES_CORE}
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
diff --git a/c/dec/decode.c b/c/dec/decode.c
index 630edeb..b7ac336 100644
--- a/c/dec/decode.c
+++ b/c/dec/decode.c
@@ -28,6 +28,8 @@
extern "C" {
#endif
+extern void _progress (uint32_t n);
+
#define BROTLI_FAILURE(CODE) (BROTLI_DUMP(), CODE)
#define BROTLI_LOG_UINT(name) \
@@ -1269,6 +1271,7 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE WriteRingBuffer(
BROTLI_LOG_UINT(to_write);
BROTLI_LOG_UINT(num_written);
s->partial_pos_out += num_written;
+ _progress(s->partial_pos_out);
if (total_out) {
*total_out = s->partial_pos_out;
}
diff --git a/c/enc/encode.c b/c/enc/encode.c
index 563c827..4effb8a 100644
--- a/c/enc/encode.c
+++ b/c/enc/encode.c
@@ -38,6 +38,8 @@
extern "C" {
#endif
+extern void _progress (uint32_t n);
+
#define COPY_ARRAY(dst, src) memcpy(dst, src, sizeof(src));
typedef enum BrotliEncoderStreamState {
@@ -1810,6 +1812,7 @@ BROTLI_BOOL BrotliEncoderCompressStream(
UpdateSizeHint(s, *available_in);
result = EncodeData(s, is_last, force_flush,
&s->available_out_, &s->next_out_);
+ _progress(s->last_processed_pos_);
if (!result) return BROTLI_FALSE;
if (force_flush) s->stream_state_ = BROTLI_STREAM_FLUSH_REQUESTED;
if (is_last) s->stream_state_ = BROTLI_STREAM_FINISHED;