#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunreachable-code"
#include <sys/cdefs.h>
#ifndef lint
#ifndef NOID
static char elsieid[] __unused = "@(#)difftime.c 8.1";
#endif
#endif
__FBSDID("$FreeBSD: src/lib/libc/stdtime/difftime.c,v 1.9 2009/05/23 06:31:50 edwin Exp $");
#include "namespace.h"
#include "private.h"
#include "un-namespace.h"
double
difftime(time1, time0)
const time_t time1;
const time_t time0;
{
if (sizeof (double) > sizeof (time_t))
return (double) time1 - (double) time0;
if (!TYPE_INTEGRAL(time_t)) {
return time1 - time0;
}
if (!TYPE_SIGNED(time_t)) {
if (time1 >= time0)
return time1 - time0;
else return -((double) (time0 - time1));
}
if ((time1 < 0) == (time0 < 0))
return time1 - time0;
if (sizeof (unsigned long) < sizeof (time_t))
return (double) time1 - (double) time0;
if (time1 >= 0 )
return (unsigned long) time1 +
(unsigned long) (-(time0 + 1)) + 1;
return -(double) ((unsigned long) time0 +
(unsigned long) (-(time1 + 1)) + 1);
}
#pragma clang diagnostic pop