From c7e8b2df1122bc95b7d7fc950c79636b65d06406 Mon Sep 17 00:00:00 2001 From: Juan Jose Casafranca Date: Mon, 2 Nov 2026 21:10:07 +0000 Subject: [PATCH] Only define the __PRETTY_FUNCTION__ fallback on MSVC GCC and Clang provide __PRETTY_FUNCTION__ as a predefined identifier, not a macro, so the #ifndef guard was always true and every file that included cuBQL had __PRETTY_FUNCTION__ replaced by __FUNCTION__. That dropped the signature from the string and broke headers that parse it, such as CCCL's cuda::std typeid when is included after cuBQL. Restrict the fallback to MSVC (excluding clang-cl, which has the builtin) and map it to __FUNCSIG__, the MSVC equivalent. Fixes #56 Signed-off-by: Juan Jose Casafranca --- cuBQL/math/common.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/cuBQL/math/common.h b/cuBQL/math/common.h index 915e2a3..db3865f 100644 --- a/cuBQL/math/common.h +++ b/cuBQL/math/common.h @@ -106,13 +106,10 @@ using cudaMemPool_t = hipMemPool_t; # define CUBQL_INTERFACE /* nothing - currently not building any special 'cubql.dll' */ -#ifndef __PRETTY_FUNCTION__ -# if defined(__func__) -# define __PRETTY_FUNCTION__ __func__ -// # define __PRETTY_FUNCTION__ __FILE__##"::"##__LINE__##": "##__FUNCTION__ -# else -# define __PRETTY_FUNCTION__ __FUNCTION__ -# endif +// GCC and Clang provide __PRETTY_FUNCTION__ as a predefined identifier, not +// a macro, so only MSVC needs a fallback. +#if defined(_MSC_VER) && !defined(__clang__) && !defined(__PRETTY_FUNCTION__) +# define __PRETTY_FUNCTION__ __FUNCSIG__ #endif