fixed timespec already defined on linux

This commit is contained in:
Jeff Hill
2000-01-26 01:33:13 +00:00
parent 82217b56a3
commit c730c64c34
6 changed files with 68 additions and 17 deletions

View File

@@ -0,0 +1,13 @@
/*
* $Id$
*
* Author: Jeff Hill
*/
#ifndef osdTimeh
#define osdTimeh
/* NOOP */
#endif /* ifndef osdTimeh */

View File

@@ -0,0 +1,19 @@
/*
* $Id$
*
* Author: Jeff Hill
*/
#ifndef osdTimeh
#define osdTimeh
/*
* I assume that this is never defined on VMS ?
*/
struct timespec {
time_t tv_sec; /* seconds since some epoch */
long tv_nsec; /* nanoseconds within the second */
};
#endif /* ifndef osdTimeh */

View File

@@ -0,0 +1,19 @@
/*
* $Id$
*
* Author: Jeff Hill
*/
#ifndef osdTimeh
#define osdTimeh
/*
* this is not defined by WIN32
*/
struct timespec {
time_t tv_sec; /* seconds since some epoch */
long tv_nsec; /* nanoseconds within the second */
};
#endif /* ifndef osdTimeh */

View File

@@ -0,0 +1,13 @@
/*
* $Id$
*
* Author: Jeff Hill
*/
#ifndef osdTimeh
#define osdTimeh
/* NOOP */
#endif /* ifndef osdTimeh */

View File

@@ -46,23 +46,8 @@ const unsigned osiTime::nSecPerSec = 1000u*osiTime::uSecPerSec;
const unsigned osiTime::nSecPerUSec = 1000u;
const unsigned osiTime::secPerMin = 60u;
//
// this is defined by POSIX 1003.1b (POSIX real time) compilant OS
//
#ifndef CLOCK_REALTIME
//
// this is part of the POSIX RT standard but some OS
// still do not define this in time.h
//
struct timespec {
time_t tv_sec; /* seconds since some epoch */
long tv_nsec; /* nanoseconds within the second */
};
struct tm *gmtime_r (const time_t *, struct tm *);
struct tm *localtime_r (const time_t *, struct tm *);
#endif
struct tm *gmtime_r (const time_t *, struct tm *);
struct tm *localtime_r (const time_t *, struct tm *);
static const unsigned ntpEpochYear = 1900;
static const unsigned ntpEpocMonth = 0; // January

View File

@@ -380,5 +380,7 @@ inline osiTime osiTime::operator = (const time_t_wrapper &rhs)
return *this;
}
#include "osdTime.h"
#endif // osiTimehInclude