52 lines · c
1// -*- C++ -*-2//===----------------------------------------------------------------------===//3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef _LIBCPP___CONFIGURATION_COMPILER_H11#define _LIBCPP___CONFIGURATION_COMPILER_H12 13#include <__config_site>14 15#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER16# pragma GCC system_header17#endif18 19#if defined(__apple_build_version__)20// Given AppleClang XX.Y.Z, _LIBCPP_APPLE_CLANG_VER is XXYZ (e.g. AppleClang 14.0.3 => 1403)21# define _LIBCPP_COMPILER_CLANG_BASED22# define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000)23#elif defined(__clang__)24# define _LIBCPP_COMPILER_CLANG_BASED25# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)26#elif defined(__GNUC__)27# define _LIBCPP_COMPILER_GCC28# define _LIBCPP_GCC_VER (__GNUC__ * 100 + __GNUC_MINOR__)29#endif30 31#ifdef __cplusplus32 33// Warn if a compiler version is used that is not supported anymore34// LLVM RELEASE Update the minimum compiler versions35# if defined(_LIBCPP_CLANG_VER)36# if _LIBCPP_CLANG_VER < 200137# warning "Libc++ only supports Clang 20 and later"38# endif39# elif defined(_LIBCPP_APPLE_CLANG_VER)40# if _LIBCPP_APPLE_CLANG_VER < 170041# warning "Libc++ only supports AppleClang 26 and later"42# endif43# elif defined(_LIBCPP_GCC_VER)44# if _LIBCPP_GCC_VER < 150045# warning "Libc++ only supports GCC 15 and later"46# endif47# endif48 49#endif50 51#endif // _LIBCPP___CONFIGURATION_COMPILER_H52