-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Include sys/time.h for cycleclock.h when building on MinGW #680
Conversation
When building for ARM, there is a fallback codepath that uses gettimeofday, which requires sys/time.h. The Windows SDK doesn't have this header, but MinGW does have it. Thus, this fixes building for Windows on ARM with MinGW headers/libraries, while Windows on ARM with the Windows SDK still is broken.
❌ Build benchmark 1447 failed (commit 9d5649b3be by @mstorsjo) |
How does this affect non-ARM MinGW builds? |
All MinGW environments have time.h and sys/time.h, so it shouldn't matter if we include these headers there, just like it is done on all non-windows platforms. |
Also just for the record; I realize this isn't the ideal full solution. I'm not extremely familiar with the lowlevel Windows timing APIs, but I think something like QueryPerformanceCounter() could be used as fallback instead of gettimeofday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks within reason to me, but i'll leave it for @dominichamon to decide.
works for me. i don't have windows (let alone arm) on which to test. |
When building for ARM, there is a fallback codepath that uses gettimeofday, which requires sys/time.h. The Windows SDK doesn't have this header, but MinGW does have it. Thus, this fixes building for Windows on ARM with MinGW headers/libraries, while Windows on ARM with the Windows SDK still is broken.
When building for ARM, there is a fallback codepath that uses
gettimeofday, which requires sys/time.h.
The Windows SDK doesn't have this header, but MinGW does have it.
Thus, this fixes building for Windows on ARM with MinGW
headers/libraries, while Windows on ARM with the Windows SDK still
is broken.