Closed mapserver-bot closed 12 years ago
Author: assefa Date: 2004/03/24 - 21:36
add mapserver-bugs@dmsolutions.ca in cc
Author: sdlime Date: 2004/03/25 - 15:39
I need to check the source, what a pain in the butt. What windows time
functionality is there? I'll look today and get back with you. Much of that
code will likely change anyway.
Steve
Author: dmorissette Date: 2004/03/25 - 17:31
FYI Steve, I was the one who added the use of gettimeofday() to produce timing
reports in msDrawMap()... useful for tuning mapfiles or finding why things are
slow sometimes.
Author: sdlime Date: 2004/03/25 - 18:37
I didn't remember using that function, thanks for the update. If that's how
it's being used, just for timing, then there's probably no reason not to
commit the fix right?
Steve
Author: nhv@cape.com Date: 2004/03/25 - 19:17
#if defined(_MSC_VER) || defined(__MINGW32__)
# include <time.h>
#ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */
#define _TIMEVAL_DEFINED
struct timeval {
long tv_sec;
long tv_usec;
};
#endif /* _TIMEVAL_DEFINED */
#else
# include <sys/time.h>
#endif
#if defined(_MSC_VER) || defined(__MINGW32__)
int gettimeofday(struct timeval* tp, void* tzp) {
DWORD t;
t = timeGetTime();
tp->tv_sec = t / 1000;
tp->tv_usec = t % 1000;
/* 0 indicates that the call succeeded. */
return 0;
}
#endif
Author: sdlime Date: 2004/03/25 - 19:35
That'll work, thanks Norman.
Author: sgillies@frii.com Date: 2004/03/25 - 22:12
Should've bumped up the severity when I cc'd myself. How about we rollback
the changes that broke MapServer until we get a fix? Where would I start?
Author: sdlime Date: 2004/03/25 - 22:36
Can't Assefa or someone else just apply Noman's code? Looks pretty straight
forward if he's right. I've no idea ho big Daniel's modifications were or when
they were done.
Steve
Author: sgillies@frii.com Date: 2004/03/25 - 22:39
Nevermind, I'll roll it back in my own checkout
cvs update -j 1.56 -j 1.54 mapdraw.c
and lower the severity. Apologies for the noise.
Author: assefa Date: 2004/03/26 - 16:45
I am out of the office for a couple of days. I will look into it tomoroow.
Author: dmorissette Date: 2004/03/27 - 19:30
Thanks for the patch Norman. Just one quick note: the tv_usec member is in
microseconds, so I think we should change its value to:
tp->tv_usec = (t % 1000) * 1000;
I would propose that the include part of Norman's patch be added to maptime.h,
and the definition of gettimeofday to maptime.c, then a #include "maptime.h" may
need to be added to the files that call gettimeofday().
Can someone test and apply the patch on Windows please?
Author: assefa Date: 2004/03/29 - 20:42
I have commited the changes so we can do a build on windows.
I have used the mstimeval internal structure as described earlier. the ifdef did
not work since other dependant libraries (libcurl, php) include winsock. If
someone else want to do other modifications, please look into files maptime.c/h
mapdraw.c
Author: dmorissette Date: 2004/03/30 - 01:37
Your changes break things on Linux/Unix because gettimeofday() doesn't like the
custom struct mstimeval... there has to be a clean way to solve that. I'll look
at what curl does.
Author: dmorissette Date: 2004/03/30 - 02:21
Curl seems to have a better solution to this problem in lib/timeval.c and
lib/timeval.h but I can't test it on windows. :(
For now I have modified the definition of gettimeofday() in maptime.c to be
msGettimeofday(), this should work fine on windows together with the custom
struct mstimeval.
On Unix/Linux, there are #defines that map struct mstimeval and msGettimeofday()
to the real things: struct timeval and gettimeofday() respectively.
Hopefully my changes didn't break the Windows build again.
Reporter: assefa Date: 2004/03/24 - 21:35 Trac URL: http://trac.osgeo.org/mapserver/ticket/602