libgcov: Fix build on Darwin [PR99406]

As reported, bootstrap currently fails on older Darwin because MAP_ANONYMOUS
is not defined.

The following is what gcc/system.h does, so I think it should work for
libgcov.

2021-03-06  Jakub Jelinek  <jakub@redhat.com>

	PR gcov-profile/99406
	* libgcov.h (MAP_FAILED, MAP_ANONYMOUS): If HAVE_SYS_MMAN_H is
	defined, define these macros if not defined already.
This commit is contained in:
Jakub Jelinek 2021-03-06 16:22:27 +01:00
parent 84185598dc
commit 73a9216b8a

View File

@ -172,6 +172,16 @@ extern struct gcov_info *gcov_list;
#define ATTRIBUTE_HIDDEN
#endif
#if HAVE_SYS_MMAN_H
#ifndef MAP_FAILED
#define MAP_FAILED ((void *)-1)
#endif
#if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
#define MAP_ANONYMOUS MAP_ANON
#endif
#endif
#include "gcov-io.h"
/* Structures embedded in coveraged program. The structures generated