--- a/ptw32_timespec.c
+++ b/ptw32_timespec.c
@@ -45,7 +45,7 @@
  * time between jan 1, 1601 and jan 1, 1970 in units of 100 nanoseconds
  */
 #define PTW32_TIMESPEC_TO_FILETIME_OFFSET \
-	  ( ((LONGLONG) 27111902 << 32) + (LONGLONG) 3577643008 )
+	  ( ((int64_t) 27111902 << 32) + (int64_t) 3577643008 )
 
 INLINE void
 ptw32_timespec_to_filetime (const struct timespec *ts, FILETIME * ft)
@@ -58,7 +58,7 @@
       * -------------------------------------------------------------------
       */
 {
-  *(LONGLONG *) ft = ts->tv_sec * 10000000
+  *(int64_t *) ft = ts->tv_sec * 10000000
     + (ts->tv_nsec + 50) / 100 + PTW32_TIMESPEC_TO_FILETIME_OFFSET;
 }
 
@@ -74,10 +74,10 @@
       */
 {
   ts->tv_sec =
-    (int) ((*(LONGLONG *) ft - PTW32_TIMESPEC_TO_FILETIME_OFFSET) / 10000000);
+    (int) ((*(int64_t *) ft - PTW32_TIMESPEC_TO_FILETIME_OFFSET) / 10000000);
   ts->tv_nsec =
-    (int) ((*(LONGLONG *) ft - PTW32_TIMESPEC_TO_FILETIME_OFFSET -
-	    ((LONGLONG) ts->tv_sec * (LONGLONG) 10000000)) * 100);
+    (int) ((*(int64_t *) ft - PTW32_TIMESPEC_TO_FILETIME_OFFSET -
+	    ((int64_t) ts->tv_sec * (int64_t) 10000000)) * 100);
 }
 
 #endif /* NEED_FTIME */