mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-20 14:20:36 +02:00
c11/threads: fix build on c23
C23/glibc is now including once_init in stdlib.h
https://patchwork.sourceware.org/project/glibc/patch/78061085-f04a-0c45-107b-5a8a15521083@redhat.com/#213088
Just fix up our use of it.
Cc: mesa-stable
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
(cherry picked from commit 179e744f75)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38432>
This commit is contained in:
parent
263e1823d2
commit
0ef221f4a4
3 changed files with 5 additions and 2 deletions
|
|
@ -1644,7 +1644,7 @@
|
|||
"description": "c11/threads: fix build on c23",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -46,12 +46,13 @@ impl_thrd_routine(void *p)
|
|||
|
||||
/*--------------- 7.25.2 Initialization functions ---------------*/
|
||||
// 7.25.2.1
|
||||
#ifndef __once_flag_defined
|
||||
void
|
||||
call_once(once_flag *flag, void (*func)(void))
|
||||
{
|
||||
pthread_once(flag, func);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*------------- 7.25.3 Condition variable functions -------------*/
|
||||
// 7.25.3.1
|
||||
|
|
|
|||
|
|
@ -118,8 +118,10 @@ typedef pthread_cond_t cnd_t;
|
|||
typedef pthread_t thrd_t;
|
||||
typedef pthread_key_t tss_t;
|
||||
typedef pthread_mutex_t mtx_t;
|
||||
#ifndef __once_flag_defined
|
||||
typedef pthread_once_t once_flag;
|
||||
# define ONCE_FLAG_INIT PTHREAD_ONCE_INIT
|
||||
#endif
|
||||
# ifdef PTHREAD_DESTRUCTOR_ITERATIONS
|
||||
# define TSS_DTOR_ITERATIONS PTHREAD_DESTRUCTOR_ITERATIONS
|
||||
# else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue