|
Revision 1954, 1.4 kB
(checked in by ensc, 4 years ago)
|
workaround warning messages regarding 'warn_unused_return_value' when
using _FORTIFY_SOURCE.
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
#ifndef H_UTILVSERVER_LIB_INTERNAL_COREASSERT_H |
|---|
| 20 |
#define H_UTILVSERVER_LIB_INTERNAL_COREASSERT_H |
|---|
| 21 |
|
|---|
| 22 |
#ifndef ENSC_TESTSUITE |
|---|
| 23 |
# error Do not use <coreassert.h> outside of testenvironemnts! |
|---|
| 24 |
#endif |
|---|
| 25 |
|
|---|
| 26 |
#include "lib_internal/util-io.h" |
|---|
| 27 |
|
|---|
| 28 |
#include <assert.h> |
|---|
| 29 |
#include <unistd.h> |
|---|
| 30 |
|
|---|
| 31 |
#undef assert |
|---|
| 32 |
#define ASSERT_STRX(X) #X |
|---|
| 33 |
#define ASSERT_STR(X) ASSERT_STRX(X) |
|---|
| 34 |
#define ASSERT_WRITE(X) Vwrite(2, (X), sizeof(X)-1) |
|---|
| 35 |
#define assert(X) \ |
|---|
| 36 |
(!(X)) ? \ |
|---|
| 37 |
ASSERT_WRITE(__FILE__ ":" ASSERT_STR(__LINE__) \ |
|---|
| 38 |
" Assertion: '" #X "' failed\n"), \ |
|---|
| 39 |
*(char *)(0)=0 : 0 |
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
#endif // H_UTILVSERVER_LIB_INTERNAL_COREASSERT_H |
|---|