diff options
Diffstat (limited to 'c/enc/encode.c')
-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_; |