It doesn't fit in a 32-bit signed integral constant, so make sure it's
64-bit; the only use is to subtract it from a 64-bit signed integral
value.
#include <fcntl.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/types.h>
+#ifdef _MSC_VER
+ /*
+ * Compiler is MSVC.
+ *
+ * Microsoft's documentation doesn't speak of LL as a valid
+ * suffix for 64-bit integers, so we'll just use i64.
+ */
+ #define INT64_T_CONSTANT(constant) (constant##i64)
+#else
+ /*
+ * Non-Microsoft compiler; assume LL works.
+ */
+ #define INT64_T_CONSTANT(constant) (constant##LL)
+#endif
+
#ifdef _MSC_VER
#define stat _stat
#define open _open
#ifdef _MSC_VER
#define stat _stat
#define open _open
+/*
+ * Assume LL works.
+ */
+#define INT64_T_CONSTANT(constant) (constant##LL)
+
#endif /* _WIN32 */
#ifndef HAVE___ATTRIBUTE__
#endif /* _WIN32 */
#ifndef HAVE___ATTRIBUTE__
/*
* Definitions for the masses
*/
/*
* Definitions for the masses
*/
-#define JAN_1970 2208988800 /* 1970 - 1900 in seconds */
+#define JAN_1970 INT64_T_CONSTANT(2208988800) /* 1970 - 1900 in seconds */
/*
* Structure definitions for NTP fixed point values
/*
* Structure definitions for NTP fixed point values