#ifndef NTP_UNIXTIME_H
#define NTP_UNIXTIME_H
#include "ntp_types.h"
#include "ntp_calendar.h"
#ifdef SIM
# define GETTIMEOFDAY(a, b) (node_gettime(&ntp_node, a))
# define SETTIMEOFDAY(a, b) (node_settime(&ntp_node, a))
# define ADJTIMEOFDAY(a, b) (node_adjtime(&ntp_node, a, b))
#else
# define ADJTIMEOFDAY(a, b) (adjtime(a, b))
# if defined(HAVE_SYS_TIMERS_H) && defined(HAVE_GETCLOCK)
# include <sys/timers.h>
int getclock (int clock_type, struct timespec *tp);
# define GETTIMEOFDAY(a, b) (gettimeofday(a, b))
# define SETTIMEOFDAY(a, b) (settimeofday(a, b))
# else
# ifdef SYSV_TIMEOFDAY
# define GETTIMEOFDAY(a, b) (gettimeofday(a))
# define SETTIMEOFDAY(a, b) (settimeofday(a))
# else
#if defined SYS_CYGWIN32
# define GETTIMEOFDAY(a, b) (gettimeofday(a, b))
# define SETTIMEOFDAY(a, b) (settimeofday_NT(a))
#else
# define GETTIMEOFDAY(a, b) (gettimeofday(a, b))
# define SETTIMEOFDAY(a, b) (settimeofday(a, b))
#endif
# endif
# endif
#endif
#define JAN_1970 ((u_int)NTP_TO_UNIX_DAYS * (u_int)SECSPERDAY)
#endif