summaryrefslogtreecommitdiff
path: root/lib/util/time.h
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2010-01-07 00:40:09 +0100
committerBjörn Jacke <bj@sernet.de>2010-01-07 00:50:29 +0100
commit571ee54b791b93ad46e09ed563ef4a5582dcf0c8 (patch)
tree529350fdfde09ca9f0dd585dee0b79cba5b935cc /lib/util/time.h
parentb3e065e0c672426a473d13c14f43f557c98d9909 (diff)
downloadsamba-571ee54b791b93ad46e09ed563ef4a5582dcf0c8.tar.gz
samba-571ee54b791b93ad46e09ed563ef4a5582dcf0c8.tar.bz2
samba-571ee54b791b93ad46e09ed563ef4a5582dcf0c8.zip
lib/util: move TIME_T_MIN/MAX defines into header file
Diffstat (limited to 'lib/util/time.h')
-rw-r--r--lib/util/time.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/util/time.h b/lib/util/time.h
index e40de2de3d..cf6dc1caa7 100644
--- a/lib/util/time.h
+++ b/lib/util/time.h
@@ -23,6 +23,20 @@
#define _PUBLIC_
#endif
+#ifndef TIME_T_MIN
+/* we use 0 here, because (time_t)-1 means error */
+#define TIME_T_MIN 0
+#endif
+
+/*
+ * we use the INT32_MAX here as on 64 bit systems,
+ * gmtime() fails with INT64_MAX
+ */
+#ifndef TIME_T_MAX
+#define TIME_T_MAX MIN(INT32_MAX,_TYPE_MAXIMUM(time_t))
+#endif
+
+
/* 64 bit time (100 nanosec) 1601 - cifs6.txt, section 3.5, page 30, 4 byte aligned */
typedef uint64_t NTTIME;