diff options
author | Brotli <no-reply@google.com> | 2024-04-22 02:06:42 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-04-22 02:07:25 -0700 |
commit | d01a4caaa80c0072fe1b6bf073814b9400667fcc (patch) | |
tree | 011d53054fa77ae69a957f5781976bcf79890951 /c/enc | |
parent | 1b3a5ccb6e7b9384b741437532f4dae0730c61f2 (diff) | |
download | brotli-d01a4caaa80c0072fe1b6bf073814b9400667fcc.zip brotli-d01a4caaa80c0072fe1b6bf073814b9400667fcc.tar.gz brotli-d01a4caaa80c0072fe1b6bf073814b9400667fcc.tar.bz2 |
Internal change
PiperOrigin-RevId: 626960053
Diffstat (limited to 'c/enc')
-rw-r--r-- | c/enc/encode.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/c/enc/encode.c b/c/enc/encode.c index 491361b..96c517b 100644 --- a/c/enc/encode.c +++ b/c/enc/encode.c @@ -687,7 +687,23 @@ static void BrotliEncoderCleanupParams(MemoryManager* m, BrotliCleanupSharedEncoderDictionary(m, ¶ms->dictionary); } +#ifdef BROTLI_REPORTING +/* When BROTLI_REPORTING is defined extra reporting module have to be linked. */ +void BrotliEncoderOnStart(const BrotliEncoderState* s); +void BrotliEncoderOnFinish(const BrotliEncoderState* s); +#define BROTLI_ENCODER_ON_START(s) BrotliEncoderOnStart(s); +#define BROTLI_ENCODER_ON_FINISH(s) BrotliEncoderOnFinish(s); +#else +#if !defined(BROTLI_ENCODER_ON_START) +#define BROTLI_ENCODER_ON_START(s) (void)(s); +#endif +#if !defined(BROTLI_ENCODER_ON_FINISH) +#define BROTLI_ENCODER_ON_FINISH(s) (void)(s); +#endif +#endif + static void BrotliEncoderInitState(BrotliEncoderState* s) { + BROTLI_ENCODER_ON_START(s); BrotliEncoderInitParams(&s->params); s->input_pos_ = 0; s->num_commands_ = 0; @@ -743,16 +759,6 @@ BrotliEncoderState* BrotliEncoderCreateInstance( return state; } -#ifdef BROTLI_REPORTING -/* When BROTLI_REPORTING is defined extra reporting module have to be linked. */ -void BrotliEncoderOnFinish(const BrotliEncoderState* s); -#define BROTLI_ENCODER_ON_FINISH(s) BrotliEncoderOnFinish(s); -#else -#if !defined(BROTLI_ENCODER_ON_FINISH) -#define BROTLI_ENCODER_ON_FINISH(s) (void)(s); -#endif -#endif - static void BrotliEncoderCleanupState(BrotliEncoderState* s) { MemoryManager* m = &s->memory_manager_; |