Skip to content

Commit 448247a

Browse files
author
falkTX
committed
Use runtime abort-on-violation on the manual functions
1 parent 64b2be1 commit 448247a

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

manual.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ void * calloc(size_t nmemb, size_t size)
3232
if (in_rt)
3333
{
3434
printf("calloc() is called while in rt section\n");
35-
#if ABORT_ON_VIOLATION
36-
abort();
37-
#endif
35+
if (abort_on_violation)
36+
abort();
3837
}
3938
if(!callocp)
4039
{
@@ -61,10 +60,9 @@ int pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex, const
6160

6261
if (in_rt)
6362
{
64-
printf("pthread_cond_timedwait() is called while in rt section\n");
65-
#if ABORT_ON_VIOLATION
66-
abort();
67-
#endif
63+
printf("pthread_cond_timedwait() is called while in rt section\n");
64+
if (abort_on_violation)
65+
abort();
6866
}
6967

7068
if(!func)
@@ -86,10 +84,9 @@ int pthread_cond_wait(pthread_cond_t * cond, pthread_mutex_t * mutex)
8684

8785
if (in_rt)
8886
{
89-
printf("pthread_cond_wait() is called while in rt section\n");
90-
#if ABORT_ON_VIOLATION
91-
abort();
92-
#endif
87+
printf("pthread_cond_wait() is called while in rt section\n");
88+
if (abort_on_violation)
89+
abort();
9390
}
9491

9592
if(!func)

0 commit comments

Comments
 (0)