Skip to content
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

Replace #defines with C++ constants and inline functions in exor.h #656

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

rocallahan
Copy link
Contributor

Using #define for short/common names like BPI and DIFFERENT can break the build when #included alongside unrelated code that uses those identifiers.

I have also removed the code that supports int sizes other than 32 bits. There aren't any viable architectures where int is not 32 bits.

@rocallahan rocallahan marked this pull request as draft July 24, 2024 23:43
@rocallahan
Copy link
Contributor Author

ABC is building this code in C translation units so I have to do this differently in a C-compatible way.

@rocallahan rocallahan marked this pull request as ready for review August 2, 2024 05:11
@rocallahan
Copy link
Contributor Author

Not sure what happened to the Mac GCC11 build in CI, but everything else seems fine and ready for review. This is basically berkeley-abc/abc@3286179

No viable platform uses anything other than 32 bits for `int`.
This avoids issues with short/common identifiers like `BPI`
and `DIFFERENT` colliding with identifiers used in other projects.
@rocallahan
Copy link
Contributor Author

@aletempiac can you please take a look at this? I landed this in upstream ABC a while back.

@aletempiac aletempiac merged commit 51dd6a0 into lsils:master Sep 24, 2024
15 checks passed
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