Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:40:43

0001 // Copyright 2017 The Abseil Authors.
0002 //
0003 // Licensed under the Apache License, Version 2.0 (the "License");
0004 // you may not use this file except in compliance with the License.
0005 // You may obtain a copy of the License at
0006 //
0007 //      https://www.apache.org/licenses/LICENSE-2.0
0008 //
0009 // Unless required by applicable law or agreed to in writing, software
0010 // distributed under the License is distributed on an "AS IS" BASIS,
0011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0012 // See the License for the specific language governing permissions and
0013 // limitations under the License.
0014 //
0015 // -----------------------------------------------------------------------------
0016 // File: policy_checks.h
0017 // -----------------------------------------------------------------------------
0018 //
0019 // This header enforces a minimum set of policies at build time, such as the
0020 // supported compiler and library versions. Unsupported configurations are
0021 // reported with `#error`. This enforcement is best effort, so successfully
0022 // compiling this header does not guarantee a supported configuration.
0023 
0024 #ifndef ABSL_BASE_POLICY_CHECKS_H_
0025 #define ABSL_BASE_POLICY_CHECKS_H_
0026 
0027 // Included for the __GLIBC_PREREQ macro used below.
0028 #include <limits.h>
0029 
0030 // Included for the _STLPORT_VERSION macro used below.
0031 #if defined(__cplusplus)
0032 #include <cstddef>
0033 #endif
0034 
0035 // -----------------------------------------------------------------------------
0036 // Operating System Check
0037 // -----------------------------------------------------------------------------
0038 
0039 #if defined(__CYGWIN__)
0040 #error "Cygwin is not supported."
0041 #endif
0042 
0043 // -----------------------------------------------------------------------------
0044 // Toolchain Check
0045 // -----------------------------------------------------------------------------
0046 
0047 // We support Visual Studio 2019 (MSVC++ 16.0) and later.
0048 // This minimum will go up.
0049 #if defined(_MSC_VER) && _MSC_VER < 1920 && !defined(__clang__)
0050 #error "This package requires Visual Studio 2019 (MSVC++ 16.0) or higher."
0051 #endif
0052 
0053 // We support GCC 7 and later.
0054 // This minimum will go up.
0055 #if defined(__GNUC__) && !defined(__clang__)
0056 #if __GNUC__ < 7
0057 #error "This package requires GCC 7 or higher."
0058 #endif
0059 #endif
0060 
0061 // We support Apple Xcode clang 4.2.1 (version 421.11.65) and later.
0062 // This corresponds to Apple Xcode version 4.5.
0063 // This minimum will go up.
0064 #if defined(__apple_build_version__) && __apple_build_version__ < 4211165
0065 #error "This package requires __apple_build_version__ of 4211165 or higher."
0066 #endif
0067 
0068 // -----------------------------------------------------------------------------
0069 // C++ Version Check
0070 // -----------------------------------------------------------------------------
0071 
0072 // Enforce C++14 as the minimum.
0073 #if defined(_MSVC_LANG)
0074 #if _MSVC_LANG < 201402L
0075 #error "C++ versions less than C++14 are not supported."
0076 #endif  // _MSVC_LANG < 201402L
0077 #elif defined(__cplusplus)
0078 #if __cplusplus < 201402L
0079 #error "C++ versions less than C++14 are not supported."
0080 #endif  // __cplusplus < 201402L
0081 #endif
0082 
0083 // -----------------------------------------------------------------------------
0084 // Standard Library Check
0085 // -----------------------------------------------------------------------------
0086 
0087 #if defined(_STLPORT_VERSION)
0088 #error "STLPort is not supported."
0089 #endif
0090 
0091 // -----------------------------------------------------------------------------
0092 // `char` Size Check
0093 // -----------------------------------------------------------------------------
0094 
0095 // Abseil currently assumes CHAR_BIT == 8. If you would like to use Abseil on a
0096 // platform where this is not the case, please provide us with the details about
0097 // your platform so we can consider relaxing this requirement.
0098 #if CHAR_BIT != 8
0099 #error "Abseil assumes CHAR_BIT == 8."
0100 #endif
0101 
0102 // -----------------------------------------------------------------------------
0103 // `int` Size Check
0104 // -----------------------------------------------------------------------------
0105 
0106 // Abseil currently assumes that an int is 4 bytes. If you would like to use
0107 // Abseil on a platform where this is not the case, please provide us with the
0108 // details about your platform so we can consider relaxing this requirement.
0109 #if INT_MAX < 2147483647
0110 #error "Abseil assumes that int is at least 4 bytes. "
0111 #endif
0112 
0113 #endif  // ABSL_BASE_POLICY_CHECKS_H_