summaryrefslogtreecommitdiff
path: root/sysutils/radmind/patches/patch-largefile.h
blob: 424b8497306cd519829b487dd65b104c50028ef3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$NetBSD: patch-largefile.h,v 1.2 2018/12/18 14:16:18 hauke Exp $

Fix for Radmind bug #221, accomodating for 64 bit time_t

--- largefile.h.orig	2010-12-13 03:42:49.000000000 +0000
+++ largefile.h
@@ -18,3 +18,19 @@
 #define strtoofft(x,y,z)	(strtol((x),(y),(z)))
 #define PRIofft			"l"
 #endif
+
+#ifndef SIZEOF_TIME_T
+#error "sizeof time_t unknown."
+#endif
+
+#if SIZEOF_TIME_T == 8
+    #ifdef HAVE_STRTOLL
+    #define strtotimet(x,y,z)	(strtoll((x),(y),(z)))
+    #else /* !HAVE_STRTOLL */
+    #define strtotimet(x,y,z)	(strtol((x),(y),(z)))
+    #endif /* HAVE_STRTOLL */
+    #define PRItimet		"ll"
+#else /* SIZEOF_TIME_T != 8 */
+    #define strtotimet(x,y,z)	(strtol((x),(y),(z)))
+    #define PRItimet		"l"
+#endif /* SIZEOF_TIME_T */