This PR resolves #296. I changed windows.h header for Winsock2.h. This way the library still works even when used with WIN32_LEAN_AND_MEAN preprocessor definition.
I think even better solution would be to move function gettimeofday in time_util.c which is the only place where it is used. This way we can also move any required headers (either windows.h, winsock.h or Winsock2.h) from header file which would prevent any side effects to other libraries.
I added a new standard CMake pipeline to the CI that tests multiple compilers on different systems. Could you rebase your PR and add a setting for "WIN32_LEAN_AND_MEAN"?
This PR resolves #296. I changed
windows.h
header forWinsock2.h
. This way the library still works even when used withWIN32_LEAN_AND_MEAN
preprocessor definition.I think even better solution would be to move function
gettimeofday
intime_util.c
which is the only place where it is used. This way we can also move any required headers (eitherwindows.h
,winsock.h
orWinsock2.h
) from header file which would prevent any side effects to other libraries.https://github.com/AprilRobotics/apriltag/blob/cc655ad6e3dadb19658276f7476dad5e92f05144/common/time_util.h#L41