From e044819338009d646f06a398aba9a3ec920fecc7 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 30 Aug 2004 15:52:09 +0000 Subject: [PATCH] gcov-io.c (GCOV_CHECK): Use gcc_assert when available. * gcov-io.c (GCOV_CHECK): Use gcc_assert when available. * gcov.c (abort): Remove undef. From-SVN: r86781 --- gcc/ChangeLog | 3 +++ gcc/gcov-io.h | 9 +++++++-- gcc/gcov.c | 1 - 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3bf8503f499..fdd8639121f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2004-08-30 Nathan Sidwell + * gcov-io.c (GCOV_CHECK): Use gcc_assert when available. + * gcov.c (abort): Remove undef. + * tree.h (BINFO_PRIMARY_BASE_OF): Remove. (struct tree_binfo): Remove primary field. 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) diff --git a/gcc/gcov.c b/gcc/gcov.c index 0e6a6f8de49..83515967cdd 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -47,7 +47,6 @@ Boston, MA 02111-1307, USA. */ #include "tm.h" #include "intl.h" #include "version.h" -#undef abort #include -- 2.30.2