summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2024-03-18 23:29:25 +0000
committerVincent Sanders <vince@kyllikki.org>2024-03-18 23:29:25 +0000
commit8e4e92fc866f7280515ddf4c07e3b0080bf274db (patch)
tree3a6b08b1d38e971cab4798146631fdcafde297fc
parent9e4f598b7b2f6f92304f5f9e4ed359e7905b37a9 (diff)
downloadnetsurf-master.tar.gz
netsurf-master.tar.bz2
fix gcov flushing in assert exitHEADmaster
-rw-r--r--test/assert.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/assert.c b/test/assert.c
index d21926e5e..fb4db8cc9 100644
--- a/test/assert.c
+++ b/test/assert.c
@@ -30,7 +30,23 @@ __ns_assert_fail(const char *__assertion, const char *__file,
unsigned int __line, const char *__function)
__THROW __attribute__ ((__noreturn__));
-/* We use this to flush coverage data */
+#if __GNUC__ > 10
+
+/* We use this to dump coverage data in gcc 11 and later */
+extern void __gcov_dump(void);
+
+/* And here's our entry point */
+void
+__ns_assert_fail(const char *__assertion, const char *__file,
+ unsigned int __line, const char *__function)
+{
+ __gcov_dump();
+ __assert_fail(__assertion, __file, __line, __function);
+}
+
+#else
+
+/* We use this to flush coverage data before gcc 11 */
extern void __gcov_flush(void);
/* And here's our entry point */
@@ -41,3 +57,4 @@ __ns_assert_fail(const char *__assertion, const char *__file,
__gcov_flush();
__assert_fail(__assertion, __file, __line, __function);
}
+#endif