From 992be0081965ea684eecd11034137983a0a726ac Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Tue, 19 Sep 2023 10:34:20 -0400 Subject: [PATCH] [libc++] Fix __threading_support when used with C11 threading Since we are defining these typedefs inside namespace std, we need to refer to ::once_flag (the C Standard Library version). Otherwise 'once_flag' refers to 'std::once_flag', and that's not something we can pass to the C Standard Library '::call_once()' function later on. --- libcxx/include/__threading_support | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcxx/include/__threading_support b/libcxx/include/__threading_support index eaa402abae351..ccbcc652d9e50 100644 --- a/libcxx/include/__threading_support +++ b/libcxx/include/__threading_support @@ -102,7 +102,7 @@ typedef cnd_t __libcpp_condvar_t; #define _LIBCPP_CONDVAR_INITIALIZER {} // Execute once -typedef once_flag __libcpp_exec_once_flag; +typedef ::once_flag __libcpp_exec_once_flag; #define _LIBCPP_EXEC_ONCE_INITIALIZER ONCE_FLAG_INIT // Thread id