fixed compiler error when using NVCC

fixes #198
This commit is contained in:
Mark Gillard 2023-05-18 12:02:56 +03:00
parent 45e37d7b15
commit e6d1958f92
3 changed files with 25 additions and 4 deletions

View File

@ -28,6 +28,7 @@ template:
- fixed `value_flags` not being preserved correctly when inserting into tables and arrays (#108) (@LebJe)
- fixed `toml::value::flags()` not being cleared when `std::move`-ing a value
- fixed error in README (#195) (@andrewkcorcoran)
- fixed compiler error when using NVCC (#198) (@thompsonnoahe)
<br><br>

View File

@ -78,6 +78,11 @@
#else
#define TOML_INTELLISENSE 0
#endif
#if defined(__CUDACC__) || defined(__CUDA_ARCH__) || defined(__CUDA_LIBDEVICE__)
#define TOML_CUDA 1
#else
#define TOML_CUDA 0
#endif
// special handling for apple clang; see:
// - https://github.com/marzer/tomlplusplus/issues/189
@ -272,9 +277,14 @@
// TOML_NEVER_INLINE
#ifdef _MSC_VER
#define TOML_NEVER_INLINE TOML_DECLSPEC(noinline)
#elif TOML_GCC || TOML_CLANG || TOML_HAS_ATTR(__noinline__)
#define TOML_NEVER_INLINE TOML_ATTR(__noinline__)
#elif TOML_CUDA // https://gitlab.gnome.org/GNOME/glib/-/issues/2555
TOML_ATTR(noinline)
#else
#if TOML_GCC || TOML_CLANG || TOML_HAS_ATTR(__noinline__)
#define TOML_NEVER_INLINE TOML_ATTR(__noinline__)
#endif
#endif
#ifndef TOML_NEVER_INLINE
#define TOML_NEVER_INLINE
#endif

View File

@ -114,6 +114,11 @@
#else
#define TOML_INTELLISENSE 0
#endif
#if defined(__CUDACC__) || defined(__CUDA_ARCH__) || defined(__CUDA_LIBDEVICE__)
#define TOML_CUDA 1
#else
#define TOML_CUDA 0
#endif
// special handling for apple clang; see:
// - https://github.com/marzer/tomlplusplus/issues/189
@ -300,9 +305,14 @@
// TOML_NEVER_INLINE
#ifdef _MSC_VER
#define TOML_NEVER_INLINE TOML_DECLSPEC(noinline)
#elif TOML_GCC || TOML_CLANG || TOML_HAS_ATTR(__noinline__)
#define TOML_NEVER_INLINE TOML_ATTR(__noinline__)
#elif TOML_CUDA // https://gitlab.gnome.org/GNOME/glib/-/issues/2555
TOML_ATTR(noinline)
#else
#if TOML_GCC || TOML_CLANG || TOML_HAS_ATTR(__noinline__)
#define TOML_NEVER_INLINE TOML_ATTR(__noinline__)
#endif
#endif
#ifndef TOML_NEVER_INLINE
#define TOML_NEVER_INLINE
#endif