1 //===-- Portable attributes -------------------------------------*- C++ -*-===// 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-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // This header file defines a set of macros for checking the presence of 9 // important compiler and platform features. Such macros can be used to 10 // produce portable code by parameterizing compilation based on the presence or 11 // lack of a given feature. 12 13 #ifndef LLVM_LIBC_SRC___SUPPORT_MACROS_CONFIG_H 14 #define LLVM_LIBC_SRC___SUPPORT_MACROS_CONFIG_H 15 16 // Workaround for compilers that do not support builtin detection. 17 // FIXME: This is only required for the GPU portion which should be moved. 18 #ifndef __has_builtin 19 #define __has_builtin(b) 0 20 #endif 21 22 // Compiler feature-detection. 23 // clang.llvm.org/docs/LanguageExtensions.html#has-feature-and-has-extension 24 #ifdef __has_feature 25 #define LIBC_HAS_FEATURE(f) __has_feature(f) 26 #else 27 #define LIBC_HAS_FEATURE(f) 0 28 #endif 29 30 #endif // LLVM_LIBC_SRC___SUPPORT_MACROS_CONFIG_H 31