This repo is obsolete, please see git://git.code.sf.net/p/dummynet/code@master
[ipfw.git] / ipfw / include / timeconv.h
1 /*
2  * simple override for _long_to_time()
3  */
4 #ifndef _TIMECONV_H_
5 #define _TIMECONV_H_
6 static __inline time_t
7 _long_to_time(long tlong)
8 {
9     if (sizeof(long) == sizeof(__int32_t))
10         return((time_t)(__int32_t)(tlong));
11     return((time_t)tlong);
12 }
13
14 #ifdef __linux__
15
16 /*
17  * some linux headers have variables called __unused, whereas the name
18  * is an alias for the gcc attribute on FreeBSD.
19  * We have to define __unused appropriately, but this cannot be
20  * global because it would clash with the linux headers.
21  *
22  * __unused is defined here because there is not a better place
23  * and this file is included by ipfw2.c where the offending linux
24  * headers are not included.
25  */
26 #define __unused       __attribute__ ((__unused__))
27 #endif
28
29 #endif /* _TIMECONV_H_ */