Skip to content

Commit

Permalink
ignore "cast-function-type" for portable 'pthread_create'
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch committed Jan 21, 2024
1 parent 00d1c0f commit ed0e640
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/pthreads_cross.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ int pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routin
if (thread == NULL || start_routine == NULL)
return 1;

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-function-type"
*thread = (HANDLE) CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)start_routine, arg, 0, NULL);
#pragma GCC diagnostic pop
if (*thread == NULL)
return 1;
return 0;
Expand Down

0 comments on commit ed0e640

Please sign in to comment.