From 9f4a38ec06a037a709e2324304c2f89b3f41e55a Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Mon, 7 Jan 2013 12:31:48 +0400 Subject: [PATCH] Fix missing abort() usage in atomic_ops_malloc and tests on WinCE * src/atomic_ops_malloc.c (abort): Define to _exit(-1) if _WIN32_WCE or __MINGW32CE__ (since there is no abort() in WinCE). * tests/run_parallel.h (abort): Likewise. * tests/test_stack.c (abort): Likewise. --- src/atomic_ops_malloc.c | 4 ++++ tests/run_parallel.h | 4 ++++ tests/test_stack.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/atomic_ops_malloc.c b/src/atomic_ops_malloc.c index 9e5187b..60757cf 100644 --- a/src/atomic_ops_malloc.c +++ b/src/atomic_ops_malloc.c @@ -27,6 +27,10 @@ # include #endif +#if (defined(_WIN32_WCE) || defined(__MINGW32CE__)) && !defined(abort) +# define abort() _exit(-1) /* there is no abort() in WinCE */ +#endif + /* * We round up each allocation request to the next power of two * minus one word. diff --git a/tests/run_parallel.h b/tests/run_parallel.h index 7fae0b0..42110dc 100644 --- a/tests/run_parallel.h +++ b/tests/run_parallel.h @@ -33,6 +33,10 @@ #include "atomic_ops.h" +#if (defined(_WIN32_WCE) || defined(__MINGW32CE__)) && !defined(abort) +# define abort() _exit(-1) /* there is no abort() in WinCE */ +#endif + #ifndef _WIN64 # define AO_PTRDIFF_T long #elif defined(__int64) diff --git a/tests/test_stack.c b/tests/test_stack.c index be108d9..8170e5c 100644 --- a/tests/test_stack.c +++ b/tests/test_stack.c @@ -43,6 +43,10 @@ #include "atomic_ops_stack.h" /* includes atomic_ops.h as well */ +#if (defined(_WIN32_WCE) || defined(__MINGW32CE__)) && !defined(abort) +# define abort() _exit(-1) /* there is no abort() in WinCE */ +#endif + #ifndef MAX_NTHREADS # define MAX_NTHREADS 100 #endif -- 2.40.0