From: Bart Van Assche Date: Mon, 16 Oct 2023 13:21:03 +0000 (-0700) Subject: drd/tests/thrd_create: Convert from C++ to C X-Git-Tag: VALGRIND_3_22_0~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45590cee742b438c5ac59b8879148b0badc03608;p=thirdparty%2Fvalgrind.git drd/tests/thrd_create: Convert from C++ to C --- diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index e0af0a22b8..819ce3e2d2 100755 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -660,7 +660,7 @@ endif timed_mutex_SOURCES = timed_mutex.cpp timed_mutex_CXXFLAGS = $(AM_CXXFLAGS) -std=c++0x -thrd_create_SOURCES = thrd_create.cpp +thrd_create_SOURCES = thrd_create.c if VGCONF_OS_IS_FREEBSD thrd_create_LDFLAGS = -lstdthreads endif diff --git a/drd/tests/thrd_create.c b/drd/tests/thrd_create.c new file mode 100644 index 0000000000..8553fca96b --- /dev/null +++ b/drd/tests/thrd_create.c @@ -0,0 +1,16 @@ +#include +#include + +int thread_entry(void *arg) +{ + fprintf(stderr, "Hello, world!\n"); + return 0; +} + +int main() +{ + thrd_t thr; + thrd_create(&thr, thread_entry, NULL); + thrd_join(thr, NULL); + return 0; +} diff --git a/drd/tests/thrd_create.cpp b/drd/tests/thrd_create.cpp deleted file mode 100644 index b0f3eeea86..0000000000 --- a/drd/tests/thrd_create.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -int main() -{ - thrd_t thr; - thrd_create(&thr, [](void *arg){std::cerr << "Hello, world!\n"; return 0;}, - NULL); - thrd_join(thr, NULL); - return 0; -}