Skip to content

RcppParallel.h introduces conflicting macro variables on Mac #210

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

Closed
traversc opened this issue Feb 23, 2024 · 1 comment
Closed

RcppParallel.h introduces conflicting macro variables on Mac #210

traversc opened this issue Feb 23, 2024 · 1 comment

Comments

@traversc
Copy link
Contributor

traversc commented Feb 23, 2024

On Mac, RcppParallel.h introduces TRUE and FALSE macro variables brought in from system headers (mach/boolean.h) that conflict with TRUE and FALSE definitions from R headers.

If RcppParallel.h is added to <package_name>_types.h, it then breaks RcppExports.cpp.

A simple fix could be to undef TRUE and FALSE in RcppParallel.h. Reproducible example: https://github.com/traversc/mactest/blob/main/src/mactest_types.h#L9

Alternatively, TRUE and FALSE macros could be re-assigned to something else like R_TRUE and R_FALSE in RcppExports.cpp

@kevinushey
Copy link
Contributor

Thanks for the bug report -- would you be willing to provide a PR?

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

No branches or pull requests

2 participants