From 595702c9faff4baf148901847a45b5a197ce92d5 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 20 Feb 2006 20:40:51 +0000 Subject: r13577: Move some (possibly system-defined) defines to replace.h (This used to be commit 2b3d56e153b229119fddfa7b378f4d671ee0092c) --- source4/lib/time.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'source4/lib/time.c') diff --git a/source4/lib/time.c b/source4/lib/time.c index 07c0a48c8c..7721a2c456 100644 --- a/source4/lib/time.c +++ b/source4/lib/time.c @@ -23,31 +23,17 @@ #include "includes.h" #include "system/time.h" -#ifndef CHAR_BIT -#define CHAR_BIT 8 -#endif - -/* The extra casts work around common compiler bugs. */ -#define _TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) -/* The outer cast is needed to work around a bug in Cray C 5.0.3.0. - It is necessary at least when t == time_t. */ -#define _TYPE_MINIMUM(t) ((t) (_TYPE_SIGNED (t) \ - ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0)) -#define _TYPE_MAXIMUM(t) ((t) (~ (t) 0 - _TYPE_MINIMUM (t))) - #ifndef TIME_T_MIN /* we use 0 here, because (time_t)-1 means error */ #define TIME_T_MIN 0 #endif -#ifndef TIME_T_MAX + /* * we use the INT32_MAX here as on 64 bit systems, * gmtime() fails with INT64_MAX */ -#ifndef INT32_MAX -#define INT32_MAX _TYPE_MAXIMUM(int32_t) -#endif +#ifndef TIME_T_MAX #define TIME_T_MAX MIN(INT32_MAX,_TYPE_MAXIMUM(time_t)) #endif -- cgit