Fix: error: use of undeclared identifier 'MAP_ANONYMOUS' https://github.com/r-spatial/s2/issues/245 --- a/src/absl/debugging/internal/examine_stack.cc 2023-05-13 15:29:12.000000000 -0500 +++ b/src/absl/debugging/internal/examine_stack.cc 2023-07-29 04:13:04.000000000 -0500 @@ -54,6 +54,9 @@ // Async-signal safe mmap allocator. void* Allocate(size_t num_bytes) { #ifdef ABSL_HAVE_MMAP +#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) +#define MAP_ANONYMOUS MAP_ANON +#endif void* p = ::mmap(nullptr, num_bytes, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); return p == MAP_FAILED ? nullptr : p; --- a/src/absl/debugging/internal/stack_consumption.cc 2023-05-13 15:29:12.000000000 -0500 +++ b/src/absl/debugging/internal/stack_consumption.cc 2023-07-29 04:12:12.000000000 -0500 @@ -110,6 +110,9 @@ // current stack pointer to figure out what thread is currently running. // Therefore, the alternate stack must be allocated from the main stack // itself. +#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) +#define MAP_ANONYMOUS MAP_ANON +#endif void* altstack = mmap(nullptr, kAlternateStackSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); ABSL_RAW_CHECK(altstack != MAP_FAILED, "mmap() failed");