Browse Source

Use __gcov_dump declaration from <gcov.h> if available

The function declaration provided by <gcov.h> is fine,
use it when <gcov.h> is available.

* configure.ac (AC_CHECK_HEADERS): Add gcov.h.
* defs.h [ENABLE_COVERAGE_GCOV && HAVE_GCOV_H]: Include <gcov.h>.
Dmitry V. Levin 1 month ago
parent
commit
9b91490784
2 changed files with 5 additions and 0 deletions
  1. 1
    0
      configure.ac
  2. 4
    0
      defs.h

+ 1
- 0
configure.ac View File

@@ -389,6 +389,7 @@ AC_CHECK_HEADERS(m4_normalize([
389 389
 	asm/guarded_storage.h
390 390
 	asm/sysmips.h
391 391
 	elf.h
392
+	gcov.h
392 393
 	iconv.h
393 394
 	inttypes.h
394 395
 	linux/bsg.h

+ 4
- 0
defs.h View File

@@ -1469,7 +1469,11 @@ extern const struct_sysent *const sysent_vec[SUPPORTED_PERSONALITIES];
1469 1469
 extern struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES];
1470 1470
 
1471 1471
 # ifdef ENABLE_COVERAGE_GCOV
1472
+#  ifdef HAVE_GCOV_H
1473
+#   include <gcov.h>
1474
+#  else
1472 1475
 extern void __gcov_dump(void);
1476
+#  endif
1473 1477
 #  define GCOV_DUMP __gcov_dump()
1474 1478
 # else
1475 1479
 #  define GCOV_DUMP

Loading…
Cancel
Save