Skip to content

Commit 27d64cd

Browse files
fix: add inline to constexpr vars and extern C to _mm_pause for C++ module compat (NVIDIA#2030)
Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com> Co-authored-by: Eric Niebler <eniebler@nvidia.com>
1 parent d6b3e3f commit 27d64cd

7 files changed

Lines changed: 9 additions & 9 deletions

File tree

include/stdexec/__detail/__any.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ namespace STDEXEC::__any
141141
//! 4. @c Interface<...Bases...<__value_proxy_root<Interface>>...>
142142
//! 5. @c Interface<...Bases...<__reference_proxy_root<Interface>>...>
143143

144-
constexpr size_t __default_buffer_size = 3 * sizeof(void *);
145-
constexpr char const *__pure_virt_msg = "internal error: pure virtual %s() called\n";
144+
inline constexpr size_t __default_buffer_size = 3 * sizeof(void *);
145+
inline constexpr char const *__pure_virt_msg = "internal error: pure virtual %s() called\n";
146146

147147
//////////////////////////////////////////////////////////////////////////////////////////
148148
// forward declarations

include/stdexec/__detail/__config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ namespace STDEXEC
781781
namespace STDEXEC
782782
{
783783
// Used by the STDEXEC_CATCH macro to provide a stub initialization of the exception object.
784-
constexpr struct __catch_any_lvalue_t
784+
inline constexpr struct __catch_any_lvalue_t
785785
{
786786
template <class _Tp>
787787
STDEXEC_ATTRIBUTE(host, device)

include/stdexec/__detail/__let.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ namespace STDEXEC
246246
return STDEXEC::__invoke(static_cast<_Fun&&>(__fn), __args...);
247247
};
248248

249-
constexpr auto __start_next_fn =
249+
inline constexpr auto __start_next_fn =
250250
[]<class _Fun, class _Receiver, class _Env2, class _Storage, class _Tuple>(
251251
_Fun& __fn,
252252
_Receiver& __rcvr,

include/stdexec/__detail/__meta.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,8 @@ namespace STDEXEC
899899
{};
900900
};
901901

902-
constexpr char __type_name_prefix[] = "__xyzzy<";
903-
constexpr char __type_name_suffix[] = ">::__plugh";
902+
inline constexpr char __type_name_prefix[] = "__xyzzy<";
903+
inline constexpr char __type_name_suffix[] = ">::__plugh";
904904

905905
[[nodiscard]]
906906
consteval std::string_view __find_pretty_name(std::string_view __sv) noexcept

include/stdexec/__detail/__query.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace STDEXEC
5151
using __member_query_result_t = decltype(__declval<_Env const &>().query(__declval<_Qy const &>(),
5252
__declval<_Args>()...));
5353

54-
constexpr __none_such __no_default{};
54+
inline constexpr __none_such __no_default{};
5555

5656
template <class _Query, class _Env, class... _Args>
5757
concept __has_validation = requires { _Query::template __validate<_Env, _Args...>(); };

include/stdexec/__detail/__utility.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ STDEXEC_PRAGMA_IGNORE_GNU("-Wduplicate-decl-specifier")
3131

3232
namespace STDEXEC
3333
{
34-
constexpr std::size_t __npos = ~0UL;
34+
inline constexpr std::size_t __npos = ~0UL;
3535

3636
template <class...>
3737
struct __undefined;

include/stdexec/stop_token.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ STDEXEC_PRAGMA_PUSH()
3333
STDEXEC_PRAGMA_IGNORE_GNU("-Warray-bounds")
3434

3535
#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
36-
extern void _mm_pause();
36+
extern "C" void _mm_pause();
3737
#endif
3838

3939
namespace STDEXEC::__stok

0 commit comments

Comments
 (0)