From a8f5813b843b7ec469dbd3d8a6a8743395359964 Mon Sep 17 00:00:00 2001 From: Evgenii Kliuchnikov Date: Thu, 17 Nov 2022 13:03:09 +0000 Subject: Update Documentation: - add note that brotli is a "stream" format, not an archive-like - regenerate .1 with Pandoc Build: - drop legacy "BROTLI_BUILD_PORTABLE" option - drop "BROTLI_SANITIZED" definition Code: - c: comb includes - c/enc: extract encoder state into separate header - c/enc: drop designated q10 codepath - c/enc: dealing better with flushing of empty stream - fix MSVC compilation API: - py: use library version instead of one in version.h - c: add plugable API to report consumed input / produced output - c/java: support "lean" prepared dictionaries (without copy of source) --- python/_brotli.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/_brotli.cc b/python/_brotli.cc index d4075bd..54c7363 100644 --- a/python/_brotli.cc +++ b/python/_brotli.cc @@ -2,11 +2,12 @@ #include #include #include -#include -#include "../common/version.h" + #include #include +#include + #if PY_MAJOR_VERSION >= 3 #define PyInt_Check PyLong_Check #define PyInt_AsLong PyLong_AsLong @@ -745,8 +746,9 @@ PyMODINIT_FUNC INIT_BROTLI(void) { PyModule_AddIntConstant(m, "MODE_FONT", (int) BROTLI_MODE_FONT); char version[16]; + uint32_t decoderVersion = BrotliDecoderVersion(); snprintf(version, sizeof(version), "%d.%d.%d", - BROTLI_VERSION >> 24, (BROTLI_VERSION >> 12) & 0xFFF, BROTLI_VERSION & 0xFFF); + decoderVersion >> 24, (decoderVersion >> 12) & 0xFFF, decoderVersion & 0xFFF); PyModule_AddStringConstant(m, "__version__", version); RETURN_BROTLI; -- cgit v1.1