Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cpp/src/arrow/compute/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,15 @@ struct NullHandling {
};
};

// BEGIN_ALICE change
// MacOSX defines `PREALLOCATE` as a macro in the header `vnode.h`.
// Thus, we must undefine that here to have a valid identifier.
// A bug report against upstream code should be made.
#if defined(__APPLE__) && defined(PREALLOCATE)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really have to protect only in case of APPLE? Even if no other platform defines PREALLOCATE for the moment, if this happens, the same issues will return.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Peter,

I think it is really only APPLE who would have the audacity to do this (mess with a BSD system header).

That said, the symbol PREALLOCATE seems an obvious candidate for a #define, so yes, it could pop up elsewhere too. However, I think the likeliness that some other system would define a preprocessor macro like this in a system header is rather small.

Long of the short: I think it is OK to do this only in case of __APPLE__.

Christian

# undef PREALLOCATE
#endif
// END_ALICE change

/// \brief The preference for memory preallocation of fixed-width type outputs
/// in kernel execution.
struct MemAllocation {
Expand Down