Skip to content

Commit e7a7a16

Browse files
authored
[libc++] Fix __threading_support when used with C11 threading (#66780)
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.
1 parent 2d1e8a0 commit e7a7a16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcxx/include/__threading_support

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ typedef cnd_t __libcpp_condvar_t;
102102
#define _LIBCPP_CONDVAR_INITIALIZER {}
103103

104104
// Execute once
105-
typedef once_flag __libcpp_exec_once_flag;
105+
typedef ::once_flag __libcpp_exec_once_flag;
106106
#define _LIBCPP_EXEC_ONCE_INITIALIZER ONCE_FLAG_INIT
107107

108108
// Thread id

0 commit comments

Comments
 (0)