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

MMDevice: Remove gettimeofday() for Windows #433

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

marktsuchida
Copy link
Member

@marktsuchida marktsuchida commented Jan 22, 2024

It is a bad idea to define functions named like POSIX standard ones, because other people can have the same idea and they can clash (we previously had this issue with Python < 3.7 and gettimeofday()).

Fortunately no device adapter is currently using this function on Windows, so just remove the dead code.

In modern C++, std::chrono offers better time functions for any new code that may need similar facilities.

A few errors corrected in 3 device adapters that used definitions from Windows.h, which is no longer included (without WIN32_LEAN_AND_MEAN) by DeviceUtils.h.

  • Builds on Windows
  • Builds on macOS

It is a bad idea to define functions named like POSIX standard ones,
because other people can have the same idea and they can clash (we
previously had this issue with Python < 3.7 and gettimeofday()).

Fortunately no device adapter is currently using this function on
Windows, so just remove the dead code.

In modern C++, std::chrono offers better time functions for any new code
that may need similar facilities.

A few errors corrected in 3 device adapters that used definitions from
Windows.h, which is no longer included (without WIN32_LEAN_AND_MEAN)
by DeviceUtils.h.
@marktsuchida marktsuchida merged commit 6857bb2 into main Jan 22, 2024
3 checks passed
@marktsuchida marktsuchida deleted the remove-windows-gettimeofday branch January 22, 2024 22:48
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.

1 participant