diff options
author | Eric Fiselier <eric@efcs.ca> | 2015-05-27 01:09:51 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2015-05-27 01:09:51 +0000 |
commit | 0961f6cc21773f32bea889fe5906dc1a92756dcd (patch) | |
tree | cc449e724b3b2bd055d20a79b7b293efb358547a /libcxx | |
parent | 6a92a3fe3423f48b71a1a138a8553a067246361d (diff) | |
download | bcm5719-llvm-0961f6cc21773f32bea889fe5906dc1a92756dcd.tar.gz bcm5719-llvm-0961f6cc21773f32bea889fe5906dc1a92756dcd.zip |
Get thread sleep_for test passing in C++03
llvm-svn: 238273
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp b/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp index bffb5f38b3c..27e1d2a1d42 100644 --- a/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp +++ b/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp @@ -17,14 +17,17 @@ #include <thread> #include <cstdlib> #include <cassert> +#include <cstring> #include <signal.h> #include <sys/time.h> +void sig_action(int) {} + int main() { int ec; struct sigaction action; - action.sa_handler = [](int) {}; + action.sa_handler = &sig_action; sigemptyset(&action.sa_mask); action.sa_flags = 0; @@ -32,7 +35,7 @@ int main() assert(!ec); struct itimerval it; - it.it_interval = { 0 }; + std::memset(&it, 0, sizeof(itimerval)); it.it_value.tv_sec = 0; it.it_value.tv_usec = 250000; // This will result in a SIGALRM getting fired resulting in the nanosleep |