|
| 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) 2024 NVIDIA CORPORATION & AFFILIATES. |
| 8 | +// |
| 9 | +//===----------------------------------------------------------------------===// |
| 10 | + |
| 11 | +#ifndef DETAIL_ATTRIBUTES_H |
| 12 | +#define DETAIL_ATTRIBUTES_H |
| 13 | + |
| 14 | +#include <thrust/detail/config.h> |
| 15 | +#if _THRUST_HAS_DEVICE_SYSTEM_STD |
| 16 | + |
| 17 | +// clang-format off |
| 18 | +# include _THRUST_STD_INCLUDE(__cccl/attributes.h) |
| 19 | +// clang-format on |
| 20 | + |
| 21 | +# define THRUST_DECLSPEC_EMPTY_BASES _CCCL_DECLSPEC_EMPTY_BASES |
| 22 | + |
| 23 | +#else // !_THRUST_HAS_DEVICE_SYSTEM_STD |
| 24 | + |
| 25 | +# ifdef __has_declspec_attribute |
| 26 | +# define THRUST_HAS_DECLSPEC_ATTRIBUTE(__x) __has_declspec_attribute(__x) |
| 27 | +# else // ^^^ __has_declspec_attribute ^^^ / vvv !__has_declspec_attribute vvv |
| 28 | +# define THRUST_HAS_DECLSPEC_ATTRIBUTE(__x) 0 |
| 29 | +# endif // !__has_declspec_attribute |
| 30 | + |
| 31 | +// MSVC needs extra help with empty base classes |
| 32 | +# if THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC || THRUST_HAS_DECLSPEC_ATTRIBUTE(empty_bases) |
| 33 | +# define THRUST_DECLSPEC_EMPTY_BASES __declspec(empty_bases) |
| 34 | +# else // !THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC |
| 35 | +# define THRUST_DECLSPEC_EMPTY_BASES |
| 36 | +# endif // THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC |
| 37 | + |
| 38 | +#endif // _THRUST_HAS_DEVICE_SYSTEM_STD |
| 39 | + |
| 40 | +#endif // DETAIL_ATTRIBUTES_H |
0 commit comments