Crypto++  8.8
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 8
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 880
54 
55 // Compiler version macros
56 
57 // Apple and LLVM Clang versions. Apple Clang version 7.0 roughly equals
58 // LLVM Clang version 3.7. Also see https://gist.github.com/yamaya/2924292
59 #if defined(__clang__) && defined(__apple_build_version__)
60 # define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
61 #elif defined(__clang__)
62 # define CRYPTOPP_LLVM_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
63 #endif
64 
65 // Clang pretends to be other compilers. The compiler gets into
66 // code paths that it cannot compile. Unset Clang to save the grief.
67 // Also see http://github.com/weidai11/cryptopp/issues/147.
68 
69 #if defined(__GNUC__) && !defined(__clang__)
70 # undef CRYPTOPP_APPLE_CLANG_VERSION
71 # undef CRYPTOPP_LLVM_CLANG_VERSION
72 # define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
73 #endif
74 
75 #if defined(__xlc__) || defined(__xlC__) && !defined(__clang__)
76 # undef CRYPTOPP_LLVM_CLANG_VERSION
77 # define CRYPTOPP_XLC_VERSION ((__xlC__ / 256) * 10000 + (__xlC__ % 256) * 100)
78 #endif
79 
80 #if defined(__INTEL_COMPILER) && !defined(__clang__)
81 # undef CRYPTOPP_LLVM_CLANG_VERSION
82 # define CRYPTOPP_INTEL_VERSION (__INTEL_COMPILER)
83 #endif
84 
85 #if defined(_MSC_VER) && !defined(__clang__)
86 # undef CRYPTOPP_LLVM_CLANG_VERSION
87 # define CRYPTOPP_MSC_VERSION (_MSC_VER)
88 #endif
89 
90 // To control <x86intrin.h> include. May need a guard, like GCC 4.5 and above
91 // Also see https://stackoverflow.com/a/42493893 and https://github.com/weidai11/cryptopp/issues/1198
92 #if defined(CRYPTOPP_GCC_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) || defined(CRYPTOPP_LLVM_CLANG_VERSION)
93 # define CRYPTOPP_GCC_COMPATIBLE 1
94 #endif
95 
96 #endif // CRYPTOPP_CONFIG_VERSION_H