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

thread_local is not supported on iOS 9.0 #164

Closed
theodelrieu opened this issue Nov 27, 2018 · 5 comments
Closed

thread_local is not supported on iOS 9.0 #164

theodelrieu opened this issue Nov 27, 2018 · 5 comments

Comments

@theodelrieu
Copy link

Description

thread_local is not supported on iOS 9.0.

Steps to reproduce

  • Use doctest and target iOS 9.0

Extra information

  • doctest version: v2.0.1
  • Operating System: iOS 9.0
  • Compiler+version: AppleClang 10.0
@theodelrieu
Copy link
Author

I'm afraid this one will be a bit harder to fix than #163 ...

@onqtam
Copy link
Member

onqtam commented Nov 27, 2018

On the top of my head - version 1.2.8 doesn't use anything thread-local and is C++98 - there is also a git tag... for now that is the best I can offer. The interface (API) is the same.

I suppose iOS 9 will be out of support soon...?

@theodelrieu
Copy link
Author

Fair enough, I don't really need to build tests on iOS anyway, if I do, I'll go back to 1.2.8.

Thanks!

@lasagnaphil
Copy link

Although the issue is closed as of right now, I'd like to share how I solved this problem. Right now, I'm building with MinGW clang (on Windows), which has some issues with thread_local. Fortunately, using a custom implementation of thread_local (https://github.com/wang-bin/ThreadLocal) solved the issue, although I had to edit a few lines of code in doctest.h.

Maybe in a later release, we could add the custom implementation for platforms not supporting thread_local (such as MinGW clang, vs2013, and some versions of iOS/Android).

@onqtam
Copy link
Member

onqtam commented Jan 22, 2019

@lasagnaphil I actually made it possible to use the latest doctest version 2.2.1 with platforms not supporting thread_local - see this issue:

#172

All you have to do is just to define DOCTEST_THREAD_LOCAL before including the header (without a value - just have it defined) - but don't use doctest in a multi-threaded context :)

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

No branches or pull requests

3 participants