version.h 1.7 KB

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