Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Vc/version.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*  This file is part of the Vc library. {{{
0002 Copyright © 2010-2015 Matthias Kretz <kretz@kde.org>
0003 
0004 Redistribution and use in source and binary forms, with or without
0005 modification, are permitted provided that the following conditions are met:
0006     * Redistributions of source code must retain the above copyright
0007       notice, this list of conditions and the following disclaimer.
0008     * Redistributions in binary form must reproduce the above copyright
0009       notice, this list of conditions and the following disclaimer in the
0010       documentation and/or other materials provided with the distribution.
0011     * Neither the names of contributing organizations nor the
0012       names of its contributors may be used to endorse or promote products
0013       derived from this software without specific prior written permission.
0014 
0015 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
0016 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
0017 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
0018 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
0019 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
0020 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
0021 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
0022 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0023 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0024 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0025 
0026 }}}*/
0027 
0028 #ifndef VC_VERSION_H_
0029 #define VC_VERSION_H_
0030 
0031 /**
0032  * \name Version Macros
0033  * \ingroup Utilities
0034  */
0035 //@{
0036 /**
0037  * \ingroup Utilities
0038  * Contains the version string of the %Vc headers. Same as Vc::versionString().
0039  */
0040 #define Vc_VERSION_STRING "1.4.5"
0041 
0042 /**
0043  * \ingroup Utilities
0044  * Contains the encoded version number of the %Vc headers. Same as Vc::versionNumber().
0045  */
0046 #define Vc_VERSION_NUMBER 0x01040a
0047 
0048 /**
0049  * \ingroup Utilities
0050  *
0051  * Helper macro to compare against an encoded version number.
0052  * Example:
0053  * \code
0054  * #if Vc_VERSION_NUMBER >= Vc_VERSION_CHECK(1, 0, 0)
0055  * \endcode
0056  */
0057 #define Vc_VERSION_CHECK(major, minor, patch) ((major << 16) | (minor << 8) | (patch << 1))
0058 //@}
0059 
0060 #define Vc_LIBRARY_ABI_VERSION 5
0061 
0062 ///\internal identify Vc 2.0
0063 #define Vc_IS_VERSION_2 (Vc_VERSION_NUMBER >= Vc_VERSION_CHECK(1, 70, 0))
0064 ///\internal identify Vc 1.x
0065 #define Vc_IS_VERSION_1 (Vc_VERSION_NUMBER < Vc_VERSION_CHECK(1, 70, 0))
0066 
0067 namespace Vc_VERSIONED_NAMESPACE
0068 {
0069 /**
0070  * \ingroup Utilities
0071  * \headerfile version.h <Vc/version.h>
0072  *
0073  * \returns the version string of the %Vc headers.
0074  *
0075  * \note There exists a built-in check that ensures on application startup that the %Vc version of the
0076  * library (link time) and the headers (compile time) are equal. A mismatch between headers and
0077  * library could lead to errors that are very hard to debug.
0078  * \note If you need to disable the check (it costs a very small amount of application startup time)
0079  * you can define Vc_NO_VERSION_CHECK at compile time.
0080  */
0081 inline const char *versionString() { return Vc_VERSION_STRING; }
0082 
0083 /**
0084  * \ingroup Utilities
0085  * \headerfile version.h <Vc/version.h>
0086  *
0087  * \returns the version of the %Vc headers encoded in an integer.
0088  */
0089 constexpr unsigned int versionNumber() { return Vc_VERSION_NUMBER; }
0090 }
0091 
0092 // @BEGIN SKIP GODBOLT@
0093 #if !defined(Vc_NO_VERSION_CHECK) && !defined(Vc_COMPILE_LIB)
0094 namespace Vc_VERSIONED_NAMESPACE
0095 {
0096 namespace Common
0097 {
0098 /**\internal
0099  * This function is implemented in the libVc library and checks whether the library is
0100  * compatible with the version information passed via the function parameters. If it is
0101  * incompatible the function prints a warning and aborts.
0102  */
0103 void Vc_CDECL checkLibraryAbi(unsigned int compileTimeAbi, unsigned int versionNumber,
0104                               const char *versionString);
0105 namespace
0106 {
0107 /**\internal
0108  * This constructor function is compiled into every translation unit and thus executed on
0109  * startup (before main) for as many TUs as are linked into the executable. It calls
0110  * Vc::Common::checkLibraryAbi to ensure the TU was compiled with Vc headers that are
0111  * compatible to the linked libVc.
0112  */
0113 static struct runLibraryAbiCheck {
0114     runLibraryAbiCheck()
0115     {
0116         checkLibraryAbi(Vc_LIBRARY_ABI_VERSION, Vc_VERSION_NUMBER, Vc_VERSION_STRING);
0117     }
0118 } _runLibraryAbiCheck;
0119 }  // unnamed namespace
0120 }  // namespace Common
0121 }  // namespace Vc
0122 #endif
0123 // @END SKIP GODBOLT@
0124 
0125 #endif // VC_VERSION_H_