Fix compile under clang
authorroot <root@plrg-1.ics.uci.edu>
Wed, 27 Nov 2019 22:39:51 +0000 (14:39 -0800)
committerroot <root@plrg-1.ics.uci.edu>
Wed, 27 Nov 2019 22:39:51 +0000 (14:39 -0800)
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);