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

Fix: Windows Problem #21

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/sigfn.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* @author John R. Patek Sr.
*/

#include <stdint.h>
#include <stdlib.h>
#include <signal.h>

Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ target_include_directories(sigfn PUBLIC ${SIGFN_INCLUDE} ${CMAKE_BINARY_DIR}/_de

target_include_directories(sigfn_a PUBLIC ${SIGFN_INCLUDE} ${CMAKE_BINARY_DIR}/_deps/channels-src)

set_property(TARGET sigfn PROPERTY CXX_STANDARD 17)
set_property(TARGET sigfn_a PROPERTY CXX_STANDARD 17)

target_link_libraries(sigfn PUBLIC Threads::Threads)

target_link_libraries(sigfn_a PUBLIC Threads::Threads)
Expand Down
2 changes: 2 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ add_executable(
unit.cpp
${SIGFN_SOURCES})

set_property(TARGET unit PROPERTY CXX_STANDARD 17)

target_include_directories(unit PRIVATE ${SIGFN_INCLUDE} ${CMAKE_CURRENT_SOURCE_DIR}/../src ${CMAKE_BINARY_DIR}/_deps/channels-src)

if(SIGFN_COVER)
Expand Down
6 changes: 6 additions & 0 deletions tests/unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ MAXTEST_MAIN

MAXTEST_TEST_CASE(sigfn::wait)
{
#ifndef _WIN32 // WINDOWS
const std::function<void(std::initializer_list<int>, bool)> try_catch_assert(
[](
std::initializer_list<int> signums,
Expand All @@ -318,10 +319,12 @@ MAXTEST_MAIN
try_catch_assert({INVALID_SIGNUM}, true);
signal_from_child(SIGINT, std::chrono::milliseconds(100));
try_catch_assert({SIGINT}, false);
#endif
};

MAXTEST_TEST_CASE(sigfn::wait_for)
{
#ifndef _WIN32 // WINDOWS
const std::function<void(int, bool, bool)> try_catch_assert(
[](
int signum,
Expand Down Expand Up @@ -350,10 +353,12 @@ MAXTEST_MAIN
signal_from_child(SIGINT, std::chrono::milliseconds(100));
try_catch_assert(SIGINT, false, false);
try_catch_assert(SIGINT, false, true);
#endif
};

MAXTEST_TEST_CASE(sigfn::wait_until)
{
#ifndef _WIN32 // WINDOWS
const std::function<void(int, bool, bool)> try_catch_assert(
[](
int signum,
Expand Down Expand Up @@ -382,6 +387,7 @@ MAXTEST_MAIN
signal_from_child(SIGINT, std::chrono::milliseconds(100));
try_catch_assert(SIGINT, false, false);
try_catch_assert(SIGINT, false, true);
#endif
};
}

Expand Down
Loading