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