meganz / mingw-std-threads

Standard threads implementation currently still missing on MinGW GCC on Windows
BSD 2-Clause "Simplified" License
439 stars 137 forks source link

Add -fno-exceptions support #53

Closed Maeiky closed 5 years ago

Maeiky commented 5 years ago

To be able to build without exceptions enabled. Required for Clang + Mingw with "-fno-exceptions" flag.

nmcclatchey commented 5 years ago

This PR is worthy of careful consideration, but is not quite ready for merging. Enabling the library's use even in the case of -fno-exceptions would enable even broader acceptance, provided that it does not break existing use cases. Some comments, on why I consider it unready, and how to bring it to a ready state:

Maeiky commented 5 years ago

I changed all "thow" with _throw<>. I just need some verification for the corresponding functions.

alxvasilev commented 5 years ago

__throw_system_error is implementation-specific, which makes the code non-portable (and would break if the standard library changes its internals). As nmcclatchey said, ideally this library should be usable with all other popular compilers under Windows, not only gcc.

Maeiky commented 5 years ago

I add one file "mingw.throw.h" to be more flexible and to be easily implementation-specific. For now with this, without the "-fno-exceptions" flag, the throw system is untouched, so this will work on others compilers, as is it now.

nmcclatchey commented 5 years ago

Some notes about the new commits:

BtbN commented 2 years ago

Is there a reason this was reverted? I'm running into this very issue right now.