[geos-devel] timeval.h simplification

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Thu Aug 30 16:07:08 EDT 2007

On Thu, 2007-08-30 at 11:55 -0600, Charlie Savage wrote:
> Getting MingW/Msys to work requires changing profile.h and timeval.h.  A 
> couple of years ago we added timeval.h since MingW did not include the 
> gettimeofday function.  However, this function was added to MingW last 
> summer so now the build blows up.
> This comes into play in profiler.h, which has this rather obscure logic:
> #ifndef _MSC_VER
> #  include <sys/time.h>
> #endif
> #include <geos/timeval.h>
> And then geos/timeval.h checks again for _MSC_VER, and if it is not set 
>   then sys/time.h is included.
> I simplified this to:
> #ifdef _MSC_VER
> #include <geos/timeval.h>
> #else
> #include <sys/time.h>
> #endif
> And removed the extra checking in geos/timeval.h.
> So the rule is:
> * If using MSCV++ include geos/timval.h
> * If not, include sys/time.h
> I have verified this works on MSYS and MSVC++ and am planning to check 
> the change in unless someone objects.

Ah. My MingW build system is built on version 4 which doesn't have the
functions built in :(  Perhaps there needs to be an autoconf test for



ILande - Open Source Consultancy

More information about the geos-devel mailing list