Skip to content

Commit

Permalink
[libc++] Fix __threading_support when used with C11 threading (#66780)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ldionne committed Sep 19, 2023
1 parent 2d1e8a0 commit e7a7a16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcxx/include/__threading_support
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e7a7a16

Please sign in to comment.