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

Include sys/time.h for cycleclock.h when building on MinGW #680

Merged
merged 1 commit into from
Sep 19, 2018

Conversation

mstorsjo
Copy link
Contributor

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.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 89.022% when pulling 6cbe240 on mstorsjo:windows-arm into 5261307 on google:master.

@AppVeyorBot
Copy link

Build benchmark 1447 failed (commit 9d5649b3be by @mstorsjo)

@LebedevRI
Copy link
Collaborator

How does this affect non-ARM MinGW builds?

@mstorsjo
Copy link
Contributor Author

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.

@mstorsjo
Copy link
Contributor Author

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.

Copy link
Collaborator

@LebedevRI LebedevRI left a 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.

@dmah42
Copy link
Member

dmah42 commented Sep 19, 2018

works for me. i don't have windows (let alone arm) on which to test.

@dmah42 dmah42 merged commit 439d6b1 into google:master Sep 19, 2018
@mstorsjo mstorsjo deleted the windows-arm branch September 19, 2018 12:44
JBakamovic pushed a commit to JBakamovic/benchmark that referenced this pull request Dec 6, 2018
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants