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

Noreturn and noexcept defines for Visual Studio 2013 support #327

Closed
robloh opened this issue Jan 25, 2020 · 1 comment
Closed

Noreturn and noexcept defines for Visual Studio 2013 support #327

robloh opened this issue Jan 25, 2020 · 1 comment

Comments

@robloh
Copy link

robloh commented Jan 25, 2020

Description

I need support for VS 2013 and discovered this can be achieved with a few small changes instead of defining DOCTEST_CONFIG_NO_EXCEPTIONS which removes support for REQUIRE

Steps to reproduce

  1. define DOCTEST_THREAD_LOCAL (not documented)
  2. remove [[noreturn]] and noexcept uses from doctest.h
  3. compile with VS 2013

Extra information

I propose defines are implemented for [[noreturn]] and noexcept in the same way as DOCTEST_THREAD_LOCAL is done so VS 2013 (and compilers like it that have partial C++11 support) can be used by simply defining these before including doctest.h

I am willing to submit a pull request if the above approach sounds good.

  • doctest version: v2.3.6
@onqtam
Copy link
Member

onqtam commented Jan 30, 2020

Sorry for the late reply - yes, a PR would be good! Make it against the dev branch - make sure to edit doctest.cpp and doctest_fwd.h from the parts folder and trigger a CMake build to re-update the doctest.h single header. I guess it would be something like this:

#ifndef DOCTEST_NORETURN
#define DOCTEST_NORETURN [[noreturn]]
#endif

#ifndef DOCTEST_NOEXCEPT
#define DOCTEST_NOEXCEPT noexcept
#endif

These things don't have to be documented - just like DOCTEST_THREAD_LOCAL isn't.

onqtam added a commit that referenced this issue May 17, 2020
@onqtam onqtam closed this as completed in b4fc73a May 17, 2020
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

2 participants