From aca085f8ae0275707459eeeb2159a8cab0773e6c Mon Sep 17 00:00:00 2001 From: Cameron Smith Date: Mon, 27 Apr 2026 13:58:43 -0400 Subject: [PATCH] support glibc <2.36 Signed-off-by: Cameron Smith --- c/include/nvtx3/nvtxDetail/nvtxExtPayloadTypeInfo.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/c/include/nvtx3/nvtxDetail/nvtxExtPayloadTypeInfo.h b/c/include/nvtx3/nvtxDetail/nvtxExtPayloadTypeInfo.h index 7945dbd1..dfa2826c 100644 --- a/c/include/nvtx3/nvtxDetail/nvtxExtPayloadTypeInfo.h +++ b/c/include/nvtx3/nvtxDetail/nvtxExtPayloadTypeInfo.h @@ -43,6 +43,11 @@ typedef void* nvtx_payload_pointer_type; /* `char8_t` is available as of C++20 or C23 */ #if ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || (defined(__cplusplus) && __cplusplus >= 201811L)) && !defined(__APPLE__) +/* Fallback for systems where glibc < 2.36 does not define char8_t + * in uchar.h even when the compiler supports C23 (e.g. RHEL 9). */ +#ifndef __cpp_char8_t +typedef unsigned char char8_t; +#endif #define NVTX_HAVE_CHAR8 1 #else #define NVTX_HAVE_CHAR8 0