[geos-devel] timeval.h simplification

Charlie Savage cfis at savagexi.com
Thu Aug 30 13:55:04 EDT 2007


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.

Thanks,

Charlie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.osgeo.org/pipermail/geos-devel/attachments/20070830/e0e53d1f/smime.bin


More information about the geos-devel mailing list