-
Notifications
You must be signed in to change notification settings - Fork 163
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 of timed functions on Cygwin #263
Conversation
Cygwin includes both Windows and POSIX API and, depending on the included headers, may have WIN32 macros defined. Since Boost.Thread uses pthread API on Cygwin, it should also enable POSIX API for time units (i.e. timespec).
We should the same as we do for Boost.Chrono, isn't it? |
What do you mean? |
This should probably use whatever actual threading API has been selected (via |
That feature is currently unrelated to |
Please, could you report the compilation error? |
I believe that originally even on Cygwin Boost.Thread didn't used the pthread api. |
What compilation does it break? I'm pretty sure we had the tests passing under Cygwin at one point. The default under Cygwin is pthread, but you can use |
It breaks Boost.Log with errors like this:
I've added a commit to select the timing API based on the threading API. |
I tried the tests under Cygwin (before this patch), and they all pass both with |
Could this fix be merged to master, please? |
I suspect that Peter is asking for a test case that probes there is an issue, isn't it? |
Andrey, please, could you provide a test case? |
The new set of tests iterates over Boost.Thread public headers and verifies that each header is self-contained, i.e. doesn't have any missing includes and contains syntactically correct content. On Windows and Cygwin, a second test per each header is generated, which includes the header after windows.h. This verifies that the header doesn't have conflicts with Windows SDK and that includeing windows.h does not break platform detection in Boost.Thread. This set of tests would have detected the bug fixed by boostorg#263.
Thanks, I will do the merge as soon as possible. |
Cygwin includes both Windows and POSIX API and, depending on the included headers, may have WIN32 macros defined. Since Boost.Thread uses pthread API on Cygwin, it should also enable POSIX API for time units (i.e. timespec).