Closed GoogleCodeExporter closed 9 years ago
thanks! but can't we just use the windows.h version then for _MSC_VER? time.?pp
are
not the only place where timeval is used, and I'd prefer to have as little
special
casing as possible..
Original comment by mark.duf...@gmail.com
on 7 Jun 2010 at 6:45
Original comment by mark.duf...@gmail.com
on 7 Jun 2010 at 6:45
Yes, besides time module the datetime and socket module also use that
structure. As we know, the libc header files in linux also has the same name
structure, might be a potential problem when adding more modules if we don't
change the name.
Original comment by jason.mi...@gmail.com
on 8 Jun 2010 at 1:56
I'm not sure I understand - there are no problems under linux, exactly because
we are using the builtin, so there are no conflicting versions. it looks like
for _MSC_VER, we can just include windows.h, instead of defining our own struct.
Original comment by mark.duf...@gmail.com
on 8 Jun 2010 at 6:54
hhaha, got you. :) A small change is enough as below, passed my test
time.hpp:
#if defined( _MSC_VER )
//struct timeval {
// long tv_sec; /* seconds */
// long tv_usec; /* and microseconds */
//};
#include <windows.h> // using the timeval struct definition in windows.h which is exactly the same with the above def
#include <time.h>
#include <sys/timeb.h>
#else
#include <sys/time.h>
#endif
Original comment by jason.mi...@gmail.com
on 9 Jun 2010 at 1:52
committed! please verify..
Original comment by mark.duf...@gmail.com
on 9 Jun 2010 at 11:06
time module test passed
Original comment by jason.mi...@gmail.com
on 13 Jun 2010 at 9:37
thanks again! closing then..
Original comment by mark.duf...@gmail.com
on 13 Jun 2010 at 4:03
Original issue reported on code.google.com by
jason.mi...@gmail.com
on 7 Jun 2010 at 10:15