Path: blob/main/contrib/llvm-project/libcxx/include/__configuration/compiler.h
35260 views
// -*- C++ -*-1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//89#ifndef _LIBCPP___CONFIGURATION_COMPILER_H10#define _LIBCPP___CONFIGURATION_COMPILER_H1112#include <__config_site>1314#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER15# pragma GCC system_header16#endif1718#if defined(__apple_build_version__)19// Given AppleClang XX.Y.Z, _LIBCPP_APPLE_CLANG_VER is XXYZ (e.g. AppleClang 14.0.3 => 1403)20# define _LIBCPP_COMPILER_CLANG_BASED21# define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000)22#elif defined(__clang__)23# define _LIBCPP_COMPILER_CLANG_BASED24# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)25#elif defined(__GNUC__)26# define _LIBCPP_COMPILER_GCC27# define _LIBCPP_GCC_VER (__GNUC__ * 100 + __GNUC_MINOR__)28#endif2930#ifdef __cplusplus3132// Warn if a compiler version is used that is not supported anymore33// LLVM RELEASE Update the minimum compiler versions34#if defined(_LIBCPP_ENABLE_COMPILER_VERSION_CHECKS) // FreeBSD customization35# if defined(_LIBCPP_CLANG_VER)36# if _LIBCPP_CLANG_VER < 170037# warning "Libc++ only supports Clang 17 and later"38# endif39# elif defined(_LIBCPP_APPLE_CLANG_VER)40# if _LIBCPP_APPLE_CLANG_VER < 150041# warning "Libc++ only supports AppleClang 15 and later"42# endif43# elif defined(_LIBCPP_GCC_VER)44# if _LIBCPP_GCC_VER < 140045# warning "Libc++ only supports GCC 14 and later"46# endif47# endif48#endif // _LIBCPP_ENABLE_COMPILER_VERSION_CHECKS4950#endif5152#endif // _LIBCPP___CONFIGURATION_COMPILER_H535455