Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compilation with WIN32_LEAN_AND_MEAN #297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mitjap
Copy link

@mitjap mitjap commented Oct 28, 2023

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.

inline int gettimeofday(struct timeval* tp, void* tzp)

@mitjap mitjap marked this pull request as draft October 28, 2023 19:31
@mitjap mitjap marked this pull request as ready for review October 28, 2023 23:31
@christian-rauch
Copy link
Collaborator

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"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compatibility with WIN32_LEAN_AND_MEAN
2 participants