diff options
author | Maria Jan Matejka <mq@jmq.cz> | 2021-12-07 16:59:44 +0000 |
---|---|---|
committer | Maria Jan Matejka <mq@jmq.cz> | 2021-12-07 16:59:44 +0000 |
commit | 493d45d95076ea1f375346942a1ce4e21dcc55e6 (patch) | |
tree | cf1a9fe0166f88d63f36d0dff2261010127549db /sysdep/unix/alloc.c | |
parent | f9e098c98af98096c8f47a054b57cff63d345074 (diff) |
Fixed build errors for OpenBSD
Diffstat (limited to 'sysdep/unix/alloc.c')
-rw-r--r-- | sysdep/unix/alloc.c | 8 |
1 files changed, 8 insertions, 0 deletions
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; |