Fix compile under clang
[c11tester.git] / threads.cc
index 61df56d773c4eaf91d273bcde0750541bcd9f0b7..5720ff77b45767432cc455a46ff94e8bc8b0d259 100644 (file)
@@ -178,7 +178,7 @@ void real_init_all() {
        }
 
        if (!pthread_exit_p) {
-               pthread_exit_p = (void (*)(void *))dlsym(RTLD_NEXT, "pthread_exit");
+               *((void (**)(void *)) &pthread_exit_p) = (void (*)(void *))dlsym(RTLD_NEXT, "pthread_exit");
                if ((error = dlerror()) != NULL) {
                        fputs(error, stderr);
                        exit(EXIT_FAILURE);