From 37fb6200830756c573b23b90ebd0ab8c8b82b94a Mon Sep 17 00:00:00 2001 From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Thu, 6 Mar 2025 03:29:24 +0800 Subject: [PATCH] Enable _Py_HOT_FUNCTION for Clang --- Include/pyport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/pyport.h b/Include/pyport.h index aabd094df54a74..e4dfb5ae6260ac 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -320,7 +320,7 @@ extern "C" { * its time must use it. Use a profiler when running performance benchmark * suite to find these functions. */ -#if defined(__GNUC__) \ +#if defined(__clang__) || defined(__GNUC__) \ && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) #define _Py_HOT_FUNCTION __attribute__((hot)) #else