Skip to content
/ arrow Public
forked from apache/arrow
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kernel.h for MacOSX #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

cholmcc
Copy link

@cholmcc cholmcc commented Nov 14, 2023

MacOSX defines the PREALLOCATE as a macro in the header vnode.h which causes compilation problems with at least AliceO2. The proposed change undefines the macro if defined so that the name PREALLOCATE may be used as an identifier here.

MacOSX defines the `PREALLOCATE` as a macro in the header `vnode.h` which causes compilation problems with at least `AliceO2`.  The proposed change `undef`ines the macro if defined so that the name `PREALLOCATE` may be used as an identifier here.
@cholmcc
Copy link
Author

cholmcc commented Nov 14, 2023

BTW, vnode.h is a BSD header but it seems only Apple - in their infinite wisdom - have this preprocessor define in that file.

@cholmcc
Copy link
Author

cholmcc commented Nov 14, 2023

I made a bug report against upstream arrow.

// 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)

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
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants