+/*
+ * To represent file timestamps, wimlib's API originally used the POSIX 'struct
+ * timespec'. This was a mistake because when building wimlib for 32-bit
+ * Windows with MinGW we ended up originally using 32-bit time_t which isn't
+ * year 2038-safe, and therefore we had to later add fields like
+ * 'creation_time_high' to hold the high 32 bits of each timestamp. Moreover,
+ * old Visual Studio versions did not define struct timespec, while newer ones
+ * define it but with 64-bit tv_sec. So to at least avoid a missing or
+ * incompatible 'struct timespec' definition, define the correct struct
+ * ourselves when this header is included on Windows.
+ */
+#ifdef _WIN32
+struct wimlib_timespec {
+ /* Seconds since start of UNIX epoch (January 1, 1970) */
+#ifdef _WIN64
+ int64_t tv_sec;
+#else
+ int32_t tv_sec;
+#endif
+ /* Nanoseconds (0-999999999) */
+ int32_t tv_nsec;
+};
+#else
+# define wimlib_timespec timespec /* standard definition */
+#endif
+