config_ver.h 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // config_ver.h - written and placed in public domain by Jeffrey Walton
  2. // the bits that make up this source file are from the
  3. // library's monolithic config.h.
  4. /// \file config_ver.h
  5. /// \brief Library configuration file
  6. /// \details <tt>config_ver.h</tt> provides defines for library and compiler
  7. /// versions.
  8. /// \details <tt>config.h</tt> was split into components in May 2019 to better
  9. /// integrate with Autoconf and its feature tests. The splitting occurred so
  10. /// users could continue to include <tt>config.h</tt> while allowing Autoconf
  11. /// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
  12. /// its feature tests.
  13. /// \note You should include <tt>config.h</tt> rather than <tt>config_ver.h</tt>
  14. /// directly.
  15. /// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
  16. /// Make config.h more autoconf friendly</A>,
  17. /// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>
  18. /// on the Crypto++ wiki
  19. /// \since Crypto++ 8.3
  20. #ifndef CRYPTOPP_CONFIG_VERSION_H
  21. #define CRYPTOPP_CONFIG_VERSION_H
  22. /// \brief Library major version
  23. /// \details CRYPTOPP_MAJOR reflects the major version of the library the
  24. /// headers came from. It is not necessarily the version of the library built
  25. /// as a shared object if versions are inadvertently mixed and matched.
  26. /// \sa CRYPTOPP_VERSION, LibraryVersion(), HeaderVersion()
  27. /// \since Crypto++ 8.2
  28. #define CRYPTOPP_MAJOR 8
  29. /// \brief Library minor version
  30. /// \details CRYPTOPP_MINOR reflects the minor version of the library the
  31. /// headers came from. It is not necessarily the version of the library built
  32. /// as a shared object if versions are inadvertently mixed and matched.
  33. /// \sa CRYPTOPP_VERSION, LibraryVersion(), HeaderVersion()
  34. /// \since Crypto++ 8.2
  35. #define CRYPTOPP_MINOR 9
  36. /// \brief Library revision number
  37. /// \details CRYPTOPP_REVISION reflects the revision number of the library the
  38. /// headers came from. It is not necessarily the revision of the library built
  39. /// as a shared object if versions are inadvertently mixed and matched.
  40. /// \sa CRYPTOPP_VERSION, LibraryVersion(), HeaderVersion()
  41. /// \since Crypto++ 8.2
  42. #define CRYPTOPP_REVISION 0
  43. /// \brief Full library version
  44. /// \details CRYPTOPP_VERSION reflects the version of the library the headers
  45. /// came from. It is not necessarily the version of the library built as a
  46. /// shared object if versions are inadvertently mixed and matched.
  47. /// \sa CRYPTOPP_MAJOR, CRYPTOPP_MINOR, CRYPTOPP_REVISION, LibraryVersion(), HeaderVersion()
  48. /// \since Crypto++ 5.6
  49. #define CRYPTOPP_VERSION 890
  50. // Compiler version macros
  51. // Apple and LLVM Clang versions. Apple Clang version 7.0 roughly equals
  52. // LLVM Clang version 3.7. Also see https://gist.github.com/yamaya/2924292
  53. #if defined(__clang__) && defined(__apple_build_version__)
  54. # define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
  55. #elif defined(__clang__) && defined(_MSC_VER)
  56. # define CRYPTOPP_MSVC_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
  57. #elif defined(__clang__)
  58. # define CRYPTOPP_LLVM_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
  59. #endif
  60. // Clang pretends to be other compilers. The compiler gets into
  61. // code paths that it cannot compile. Unset Clang to save the grief.
  62. // Also see http://github.com/weidai11/cryptopp/issues/147.
  63. #if defined(__GNUC__) && !defined(__clang__)
  64. # undef CRYPTOPP_APPLE_CLANG_VERSION
  65. # undef CRYPTOPP_LLVM_CLANG_VERSION
  66. # define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
  67. #endif
  68. #if defined(__xlc__) || defined(__xlC__) && !defined(__clang__)
  69. # undef CRYPTOPP_LLVM_CLANG_VERSION
  70. # define CRYPTOPP_XLC_VERSION ((__xlC__ / 256) * 10000 + (__xlC__ % 256) * 100)
  71. #endif
  72. #if defined(__INTEL_COMPILER) && !defined(__clang__)
  73. # undef CRYPTOPP_LLVM_CLANG_VERSION
  74. # define CRYPTOPP_INTEL_VERSION (__INTEL_COMPILER)
  75. #endif
  76. #if defined(_MSC_VER) && !defined(__clang__)
  77. # undef CRYPTOPP_LLVM_CLANG_VERSION
  78. # define CRYPTOPP_MSC_VERSION (_MSC_VER)
  79. #endif
  80. // To control <x86intrin.h> include. May need a guard, like GCC 4.5 and above
  81. // Also see https://stackoverflow.com/a/42493893 and https://github.com/weidai11/cryptopp/issues/1198
  82. #if defined(CRYPTOPP_GCC_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) || defined(CRYPTOPP_LLVM_CLANG_VERSION)
  83. # define CRYPTOPP_GCC_COMPATIBLE 1
  84. #endif
  85. #endif // CRYPTOPP_CONFIG_VERSION_H