unix: squelch -Wcast-function-type warning
PR-URL: https://github.com/libuv/libuv/pull/2346 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
parent
c4ff0457b9
commit
a5ffb50dd7
@ -222,6 +222,12 @@ int uv_thread_create_ex(uv_thread_t* tid,
|
||||
size_t pagesize;
|
||||
size_t stack_size;
|
||||
|
||||
/* Used to squelch a -Wcast-function-type warning. */
|
||||
union {
|
||||
void (*in)(void*);
|
||||
void* (*out)(void*);
|
||||
} f;
|
||||
|
||||
stack_size =
|
||||
params->flags & UV_THREAD_HAS_STACK_SIZE ? params->stack_size : 0;
|
||||
|
||||
@ -248,7 +254,8 @@ int uv_thread_create_ex(uv_thread_t* tid,
|
||||
abort();
|
||||
}
|
||||
|
||||
err = pthread_create(tid, attr, (void*(*)(void*)) entry, arg);
|
||||
f.in = entry;
|
||||
err = pthread_create(tid, attr, f.out, arg);
|
||||
|
||||
if (attr != NULL)
|
||||
pthread_attr_destroy(attr);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user