|
| 1 | +//===----------------------------------------------------------------------===// |
| 2 | +// |
| 3 | +// Part of libcu++, the C++ Standard Library for your entire system, |
| 4 | +// 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-exception |
| 7 | +// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. |
| 8 | +// |
| 9 | +//===----------------------------------------------------------------------===// |
| 10 | + |
| 11 | +#ifndef __CCCL_CONFIG |
| 12 | +#define __CCCL_CONFIG |
| 13 | + |
| 14 | +// Determine the host compiler |
| 15 | +#if defined(__NVCOMPILER) |
| 16 | +# define _CCCL_COMPILER_NVHPC |
| 17 | +#elif defined(__clang__) |
| 18 | +# define _CCCL_COMPILER_CLANG |
| 19 | +#elif defined(__GNUC__) |
| 20 | +# define _CCCL_COMPILER_GCC |
| 21 | +#elif defined(_MSC_VER) |
| 22 | +# define _CCCL_COMPILER_MSVC |
| 23 | +#elif defined(__IBMCPP__) |
| 24 | +# define _CCCL_COMPILER_IBM |
| 25 | +#elif defined(__CUDACC_RTC__) |
| 26 | +# define _CCCL_COMPILER_NVRTC |
| 27 | +#endif |
| 28 | + |
| 29 | +// Ensure cccl headers are treated as system headers when possible |
| 30 | +#if defined(_CCCL_NO_SYSTEM_HEADER) |
| 31 | +# define _CCCL_IMPLICIT_SYSTEM_HEADER |
| 32 | +#elif defined(_CCCL_COMPILER_MSVC) \ |
| 33 | + && defined(_LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING) |
| 34 | +# define _CCCL_IMPLICIT_SYSTEM_HEADER |
| 35 | +#elif defined(_CCCL_COMPILER_NVRTC) |
| 36 | +# define _CCCL_IMPLICIT_SYSTEM_HEADER |
| 37 | +#elif defined(_LIBCUDACXX_DISABLE_PRAGMA_GCC_SYSTEM_HEADER) |
| 38 | +# define _CCCL_IMPLICIT_SYSTEM_HEADER |
| 39 | +#else |
| 40 | +# if defined(_CCCL_COMPILER_GCC) |
| 41 | +# define _CCCL_IMPLICIT_SYSTEM_HEADER _Pragma("GCC system_header") |
| 42 | +# elif defined(_CCCL_COMPILER_CLANG) |
| 43 | +# define _CCCL_IMPLICIT_SYSTEM_HEADER _Pragma("clang system_header") |
| 44 | +# elif defined(_CCCL_COMPILER_MSVC) |
| 45 | +# define _CCCL_IMPLICIT_SYSTEM_HEADER __pragma(system_header) |
| 46 | +# elif defined(_CCCL_COMPILER_NVHPC) |
| 47 | +# define _CCCL_IMPLICIT_SYSTEM_HEADER _Pragma("GCC system_header") |
| 48 | +# else |
| 49 | +# define _CCCL_IMPLICIT_SYSTEM_HEADER |
| 50 | +# endif |
| 51 | +#endif |
| 52 | + |
| 53 | +_CCCL_IMPLICIT_SYSTEM_HEADER |
| 54 | + |
| 55 | +#endif // __CCCL_CONFIG |
0 commit comments