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

Wrap <csignal> include with ifdef #177

Open
bnason-nf opened this issue Jan 24, 2019 · 4 comments
Open

Wrap <csignal> include with ifdef #177

bnason-nf opened this issue Jan 24, 2019 · 4 comments
Labels

Comments

@bnason-nf
Copy link
Contributor

Hi @onqtam,

One of the platforms I am using doctest on doesn't support signals, so I made sure to disable DOCTEST_CONFIG_POSIX_SIGNALS. However, since this platform doesn't have the header either, I also had to wrap that include with an ifdef:

diff --git a/doctest/doctest.h b/doctest/doctest.h
index eda93fc..9ebc1d0 100644
--- a/doctest/doctest.h
+++ b/doctest/doctest.h
@@ -2686,7 +2686,9 @@ DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN
 #include <map>
 #include <exception>
 #include <stdexcept>
+#if defined(DOCTEST_CONFIG_POSIX_SIGNALS)
 #include <csignal>
+#endif
 #include <cfloat>
 #include <cctype>
 #include <cstdint>

I think it should be harmless if the platform does have signals. Is this something you would be willing to add to doctest? If so, please let me know if you'd like me to make a pull request.

Thanks,
Benbuck

onqtam added a commit that referenced this issue Jan 24, 2019
onqtam added a commit that referenced this issue Jan 24, 2019
@onqtam
Copy link
Member

onqtam commented Jan 24, 2019

I just pushed the changes - the CI should pass the tests as well :)

@bnason-nf
Copy link
Contributor Author

Thanks @onqtam. Sorry I forgot and provided the single include diff instead of the parts file.

-Benbuck

onqtam added a commit that referenced this issue Jan 25, 2019
@onqtam onqtam closed this as completed in 692a5a6 Jan 25, 2019
@cschreib
Copy link

This issue has reappeared in the current master branch. I noticed while trying to compile doctest to standalone wasm using Emscripten (standalone wasm doesn't have signals).

@onqtam onqtam reopened this May 26, 2023
@AlexMax
Copy link

AlexMax commented Jun 2, 2023

Can confirm, I am on a platform that does not have signals and I'm running into this error as well.

@cdeln cdeln added the type/bug label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants