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

Windows fixes #3

Merged
merged 3 commits into from
Mar 1, 2017
Merged

Windows fixes #3

merged 3 commits into from
Mar 1, 2017

Conversation

ArcaneNibble
Copy link
Contributor

No description provided.

log.h Outdated
@@ -30,6 +30,11 @@
#include <string>
#include <vector>
#include <mutex>
#ifdef _WIN32
// Include mingw-std-threads extra header
#include <mingw.mutex.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So mingw has two different threading "ABIs" for Windows: posix and native. The "posix" mode works by having a library that emulates the pthreads API using the Windows native threading capability whereas the "native" mode just doesn't have that. However, libstdc++ implements the C++11 threading interfaces using the pthreads API, so the "native" threading mode version of MinGW just doesn't have the C++ threads API available at all. So you now have two choices: a) use the "posix" version of the mingw compiler (and become dependent on the pthreads-win32 code) or b) use the "native" version of the mingw compiler (and become dependent on some other implementation of C++11 threads (which is mingw-std-threads in this case)). I somewhat-arbitrarily decided I liked option (b) better (despite the fact that yosys-abc still ends up requiring pthreads-win32 anyways).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this gated on _WIN32 and not MINGW32 though? This would break, e.g., an MSVC build, or a Clang build.

This is an implementation of C++11 threading functionality on Windows
that DOES NOT require MinGW's port of pthreads.
@ArcaneNibble
Copy link
Contributor Author

Fixed to only include mingw-std-threads when *) actually compiling with mingw and *) not using mingw posix threads.

@whitequark whitequark merged commit 1302ddd into ngscopeclient:master Mar 1, 2017
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.

None yet

2 participants