diff --git a/cpp/src/arrow/compute/kernel.h b/cpp/src/arrow/compute/kernel.h index 5b5b5718e19dc..1adb3e96c97c8 100644 --- a/cpp/src/arrow/compute/kernel.h +++ b/cpp/src/arrow/compute/kernel.h @@ -38,6 +38,12 @@ #include "arrow/util/macros.h" #include "arrow/util/visibility.h" +// macOS defines PREALLOCATE as a preprocessor macro in the header sys/vnode.h. +// No other BSD seems to do so. The name is used as an identifier in MemAllocation enum. +#if defined(__APPLE__) && defined(PREALLOCATE) +#undef PREALLOCATE +#endif + namespace arrow { namespace compute {