From 66700f0450277a4ebae4ce403a6bd591cc88d56c Mon Sep 17 00:00:00 2001 From: guptapratykshh Date: Fri, 17 Apr 2026 09:48:13 +0530 Subject: [PATCH] fix: add inline to constexpr vars and extern C to _mm_pause for C++ module compat Signed-off-by: guptapratykshh --- include/stdexec/__detail/__any.hpp | 4 ++-- include/stdexec/__detail/__config.hpp | 2 +- include/stdexec/__detail/__let.hpp | 2 +- include/stdexec/__detail/__meta.hpp | 4 ++-- include/stdexec/__detail/__query.hpp | 2 +- include/stdexec/__detail/__utility.hpp | 2 +- include/stdexec/stop_token.hpp | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/stdexec/__detail/__any.hpp b/include/stdexec/__detail/__any.hpp index 66df449a5..5abc26e89 100644 --- a/include/stdexec/__detail/__any.hpp +++ b/include/stdexec/__detail/__any.hpp @@ -141,8 +141,8 @@ namespace STDEXEC::__any //! 4. @c Interface<...Bases...<__value_proxy_root>...> //! 5. @c Interface<...Bases...<__reference_proxy_root>...> - constexpr size_t __default_buffer_size = 3 * sizeof(void *); - constexpr char const *__pure_virt_msg = "internal error: pure virtual %s() called\n"; + inline constexpr size_t __default_buffer_size = 3 * sizeof(void *); + inline constexpr char const *__pure_virt_msg = "internal error: pure virtual %s() called\n"; ////////////////////////////////////////////////////////////////////////////////////////// // forward declarations diff --git a/include/stdexec/__detail/__config.hpp b/include/stdexec/__detail/__config.hpp index f55a2b871..520be9ee9 100644 --- a/include/stdexec/__detail/__config.hpp +++ b/include/stdexec/__detail/__config.hpp @@ -781,7 +781,7 @@ namespace STDEXEC namespace STDEXEC { // Used by the STDEXEC_CATCH macro to provide a stub initialization of the exception object. - constexpr struct __catch_any_lvalue_t + inline constexpr struct __catch_any_lvalue_t { template STDEXEC_ATTRIBUTE(host, device) diff --git a/include/stdexec/__detail/__let.hpp b/include/stdexec/__detail/__let.hpp index 1c1d89fe2..b59096f80 100644 --- a/include/stdexec/__detail/__let.hpp +++ b/include/stdexec/__detail/__let.hpp @@ -246,7 +246,7 @@ namespace STDEXEC return STDEXEC::__invoke(static_cast<_Fun&&>(__fn), __args...); }; - constexpr auto __start_next_fn = + inline constexpr auto __start_next_fn = []( _Fun& __fn, _Receiver& __rcvr, diff --git a/include/stdexec/__detail/__meta.hpp b/include/stdexec/__detail/__meta.hpp index 9623bfcbb..e57538cab 100644 --- a/include/stdexec/__detail/__meta.hpp +++ b/include/stdexec/__detail/__meta.hpp @@ -899,8 +899,8 @@ namespace STDEXEC {}; }; - constexpr char __type_name_prefix[] = "__xyzzy<"; - constexpr char __type_name_suffix[] = ">::__plugh"; + inline constexpr char __type_name_prefix[] = "__xyzzy<"; + inline constexpr char __type_name_suffix[] = ">::__plugh"; [[nodiscard]] consteval std::string_view __find_pretty_name(std::string_view __sv) noexcept diff --git a/include/stdexec/__detail/__query.hpp b/include/stdexec/__detail/__query.hpp index f16dc26e6..16e73aeb8 100644 --- a/include/stdexec/__detail/__query.hpp +++ b/include/stdexec/__detail/__query.hpp @@ -51,7 +51,7 @@ namespace STDEXEC using __member_query_result_t = decltype(__declval<_Env const &>().query(__declval<_Qy const &>(), __declval<_Args>()...)); - constexpr __none_such __no_default{}; + inline constexpr __none_such __no_default{}; template concept __has_validation = requires { _Query::template __validate<_Env, _Args...>(); }; diff --git a/include/stdexec/__detail/__utility.hpp b/include/stdexec/__detail/__utility.hpp index 9de462b55..1526fe9ec 100644 --- a/include/stdexec/__detail/__utility.hpp +++ b/include/stdexec/__detail/__utility.hpp @@ -31,7 +31,7 @@ STDEXEC_PRAGMA_IGNORE_GNU("-Wduplicate-decl-specifier") namespace STDEXEC { - constexpr std::size_t __npos = ~0UL; + inline constexpr std::size_t __npos = ~0UL; template struct __undefined; diff --git a/include/stdexec/stop_token.hpp b/include/stdexec/stop_token.hpp index a2aac402c..50afb5efe 100644 --- a/include/stdexec/stop_token.hpp +++ b/include/stdexec/stop_token.hpp @@ -33,7 +33,7 @@ STDEXEC_PRAGMA_PUSH() STDEXEC_PRAGMA_IGNORE_GNU("-Warray-bounds") #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) -extern void _mm_pause(); +extern "C" void _mm_pause(); #endif namespace STDEXEC::__stok