• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2016 Google Inc. All Rights Reserved.
2 
3    Distributed under MIT license.
4    See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5 */
6 
7 /* Version definition. */
8 
9 #ifndef BROTLI_COMMON_VERSION_H_
10 #define BROTLI_COMMON_VERSION_H_
11 
12 /* Compose 3 components into a single number. In a hexadecimal representation
13    B and C components occupy exactly 3 digits. */
14 #define BROTLI_MAKE_HEX_VERSION(A, B, C) ((A << 24) | (B << 12) | C)
15 
16 /* Those macros should only be used when library is compiled together with
17    the client. If library is dynamically linked, use BrotliDecoderVersion and
18    BrotliEncoderVersion methods. */
19 
20 #define BROTLI_VERSION_MAJOR 1
21 #define BROTLI_VERSION_MINOR 1
22 #define BROTLI_VERSION_PATCH 0
23 
24 #define BROTLI_VERSION BROTLI_MAKE_HEX_VERSION(                     \
25   BROTLI_VERSION_MAJOR, BROTLI_VERSION_MINOR, BROTLI_VERSION_PATCH)
26 
27 /* This macro is used by build system to produce Libtool-friendly soname. See
28    https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
29    Version evolution rules:
30     - interfaces added (or change is compatible)      -> current+1:0:age+1
31     - interfaces removed (or changed is incompatible) -> current+1:0:0
32     - interfaces not changed                          -> current:revision+1:age
33  */
34 
35 #define BROTLI_ABI_CURRENT  2
36 #define BROTLI_ABI_REVISION 0
37 #define BROTLI_ABI_AGE      1
38 
39 #if BROTLI_VERSION_MAJOR != (BROTLI_ABI_CURRENT - BROTLI_ABI_AGE)
40 #error ABI/API version inconsistency
41 #endif
42 
43 #if BROTLI_VERSION_MINOR != BROTLI_ABI_AGE
44 #error ABI/API version inconsistency
45 #endif
46 
47 #if BROTLI_VERSION_PATCH != BROTLI_ABI_REVISION
48 #error ABI/API version inconsistency
49 #endif
50 
51 #endif  /* BROTLI_COMMON_VERSION_H_ */
52