Home » U++ Library support » U++ Core » Little problem in util.cpp and simple solution
Little problem in util.cpp and simple solution [message #35984] |
Sun, 15 April 2012 22:16 |
|
koldo
Messages: 3372 Registered: August 2008
|
Senior Veteran |
|
|
Hello Mirek
In util.cpp there is this:
#ifdef PLATFORM_POSIX
dword GetTickCount() {
struct timeval tv[1];
struct timezone tz[1];
memset(tz, 0, sizeof(tz));
gettimeofday(tv, tz);
return (dword)tv->tv_sec * 1000 + tv->tv_usec / 1000;
}
int msecs(int from) { return int((GetTickCount() - (dword)from) & 0x7fffffff); }
#endif This produces linking problems in MinGW.
Just moving msecs() outside the #ifdef solves the problem:
#ifdef PLATFORM_POSIX
dword GetTickCount() {
struct timeval tv[1];
struct timezone tz[1];
memset(tz, 0, sizeof(tz));
gettimeofday(tv, tz);
return (dword)tv->tv_sec * 1000 + tv->tv_usec / 1000;
}
#endif
int msecs(int from) { return int((GetTickCount() - (dword)from) & 0x7fffffff); }
Best regards
IƱaki
|
|
|
|
|
|
|
Goto Forum:
Current Time: Wed Jun 05 20:35:56 CEST 2024
Total time taken to generate the page: 0.01528 seconds
|