--- a/pthread_spin_destroy.c
+++ b/pthread_spin_destroy.c
@@ -56,7 +56,7 @@
 	  result = pthread_mutex_destroy (&(s->u.mutex));
 	}
       else if ((PTW32_INTERLOCKED_LONG) PTW32_SPIN_UNLOCKED !=
-	       PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG ((PTW32_INTERLOCKED_PTR) &s->interlock,
+	       PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG ((PTW32_INTERLOCKED_LONGPTR) &s->interlock,
 						   (PTW32_INTERLOCKED_LONG) PTW32_SPIN_INVALID,
 						   (PTW32_INTERLOCKED_LONG) PTW32_SPIN_UNLOCKED))
 	{