Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
koldo is currently offline  koldo
Messages: 3357
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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: LaunchWebBrowser() problem and perhaps not the best solution
Next Topic: Jsonize problems with maps
Goto Forum:
  


Current Time: Sat Apr 27 21:28:06 CEST 2024

Total time taken to generate the page: 0.02378 seconds