From 493d45d95076ea1f375346942a1ce4e21dcc55e6 Mon Sep 17 00:00:00 2001 From: Maria Jan Matejka Date: Tue, 7 Dec 2021 16:59:44 +0000 Subject: Fixed build errors for OpenBSD --- sysdep/unix/alloc.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sysdep/unix/alloc.c') diff --git a/sysdep/unix/alloc.c b/sysdep/unix/alloc.c index 81cd19b4..24384d0e 100644 --- a/sysdep/unix/alloc.c +++ b/sysdep/unix/alloc.c @@ -70,10 +70,14 @@ alloc_page(void) else #endif { +#ifdef HAVE_ALIGNED_ALLOC void *ret = aligned_alloc(page_size, page_size); if (!ret) bug("aligned_alloc(%lu) failed", page_size); return ret; +#else + bug("BIRD should have already died on fatal error."); +#endif } } @@ -214,7 +218,11 @@ void resource_sys_init(void) return; } +#ifdef HAVE_ALIGNED_ALLOC log(L_WARN "Got strange memory page size (%lu), using the aligned allocator instead", page_size); +#else + die("Got strange memory page size (%lu) and aligned_alloc is not available", page_size); +#endif /* Too big or strange page, use the aligned allocator instead */ page_size = 4096; -- cgit v1.2.3