From 03b7130b9aa43ec8fbfbd2463c37797fcd1ab450 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 30 Aug 2004 15:52:09 +0000 Subject: * gcov-io.c (GCOV_CHECK): Use gcc_assert when available. * gcov.c (abort): Remove undef. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86781 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/gcov-io.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/gcov-io.h') diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h index 50eacccdc46..eaa23adcb47 100644 --- a/gcc/gcov-io.h +++ b/gcc/gcov-io.h @@ -547,10 +547,15 @@ GCOV_LINKAGE time_t gcov_time (void); #endif /* Make sure the library is used correctly. */ +#if IN_LIBGCOV #if ENABLE_CHECKING -#define GCOV_CHECK(expr) ((expr) ? (void)0 : (void)abort ()) +#define GCOV_CHECK(EXPR) (!(EXPR) ? abort (), 0 : 0) +#else +/* Include EXPR, so that unused variable warnings do not occur. */ +#define GCOV_CHECK(EXPR) ((void)(0 && (EXPR))) +#endif #else -#define GCOV_CHECK(expr) +#define GCOV_CHECK(EXPR) gcc_assert (EXPR) #endif #define GCOV_CHECK_READING() GCOV_CHECK(gcov_var.mode > 0) #define GCOV_CHECK_WRITING() GCOV_CHECK(gcov_var.mode < 0) -- cgit v1.2.1