diff --git a/test/hello-tls.c b/test/hello-tls.c index c560233..cacc270 100644 --- a/test/hello-tls.c +++ b/test/hello-tls.c @@ -19,6 +19,7 @@ #include #include #include +#include #if defined(_MSC_VER) static __declspec(thread) int tlsvar = 1; @@ -27,7 +28,7 @@ static __thread int tlsvar = 1; #endif static unsigned __stdcall threadfunc(void* arg) { - int id = (int)arg; + int id = (int)(intptr_t)arg; printf("thread %d, tlsvar %p initially %d\n", id, &tlsvar, tlsvar); tlsvar = id + 100; for (int i = 0; i < 4; i++) {