fixed timespec already defined on linux
This commit is contained in:
13
src/libCom/osi/os/RTEMS/osdTime.h
Normal file
13
src/libCom/osi/os/RTEMS/osdTime.h
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*/
|
||||
|
||||
#ifndef osdTimeh
|
||||
#define osdTimeh
|
||||
|
||||
/* NOOP */
|
||||
|
||||
#endif /* ifndef osdTimeh */
|
||||
19
src/libCom/osi/os/VMS/osdTime.h
Normal file
19
src/libCom/osi/os/VMS/osdTime.h
Normal 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 */
|
||||
19
src/libCom/osi/os/WIN32/osdTime.h
Normal file
19
src/libCom/osi/os/WIN32/osdTime.h
Normal 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 */
|
||||
13
src/libCom/osi/os/vxWorks/osdTime.h
Normal file
13
src/libCom/osi/os/vxWorks/osdTime.h
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*/
|
||||
|
||||
#ifndef osdTimeh
|
||||
#define osdTimeh
|
||||
|
||||
/* NOOP */
|
||||
|
||||
#endif /* ifndef osdTimeh */
|
||||
@@ -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
|
||||
|
||||
@@ -380,5 +380,7 @@ inline osiTime osiTime::operator = (const time_t_wrapper &rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#include "osdTime.h"
|
||||
|
||||
#endif // osiTimehInclude
|
||||
|
||||
|
||||
Reference in New Issue
Block a user