BSD Porting fixes, conditional compilation and use of gettimeofday()
This commit is contained in:
@@ -57,10 +57,13 @@ TimeInfo::~TimeInfo()
|
||||
|
||||
void TimeInfo::setCurrent(void)
|
||||
{
|
||||
#if defined (_MSC_VER)
|
||||
#if defined (FC_OS_WIN32)
|
||||
_ftime( &timebuffer );
|
||||
#elif defined(__GNUC__)
|
||||
ftime( &timebuffer );
|
||||
#else
|
||||
struct timeval t;
|
||||
gettimeofday(&t, NULL);
|
||||
timebuffer.time = t.tv_sec;
|
||||
timebuffer.millitm = t.tv_usec / 1000;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -28,13 +28,25 @@
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#if defined(FC_OS_WIN32)
|
||||
#include <sys/timeb.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if !defined(FC_OS_WIN32)
|
||||
struct timeb
|
||||
{
|
||||
int64_t time;
|
||||
unsigned short millitm;
|
||||
};
|
||||
#endif
|
||||
|
||||
namespace Base
|
||||
{
|
||||
/// BaseClass class and root of the type system
|
||||
|
||||
Reference in New Issue
Block a user