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

Rename `BOOL` to `BOOLIFY` #1107

Merged
merged 2 commits into from Aug 13, 2019

Conversation

@gwynne
Copy link
Contributor

commented Aug 13, 2019

Rename the BOOL macro in cpp-magic.h to BOOLIFY

Motivation:

This prevents conflicts when this header is included in a project using Objective-C. As most ObjC code will use the language's unfortunately-defined (but nonetheless everpresent) BOOL type, it causes a great deal of trouble when the two definitions collide. This is not an issue for NIO itself but does show up for those using the code elsewhere.

Modifications:

A simple case-sensitive find/replace of BOOL with BOOLIFY. There is no functional change of any kind.

Result:

This header should now be more usable in projects that include Objective-C code, and we will have yet another item on the lists of 1) why Objective-C is annoying, and 2) why the C preprocessor lacking namespacing is a very bad thing.

Rename `BOOL` to `BOOLIFY`
Prevents conflicts when this header is included in a project using Objective-C.

@Lukasa Lukasa requested a review from weissi Aug 13, 2019

@Lukasa Lukasa added this to the 2.7.0 milestone Aug 13, 2019

@weissi

weissi approved these changes Aug 13, 2019

Copy link
Member

left a comment

nice one, thank you :)

@Lukasa Lukasa merged commit 584e107 into apple:master Aug 13, 2019

4 checks passed

pull request validation (5.0) Build finished.
Details
pull request validation (5.1) Build finished.
Details
pull request validation (api breakage) Build finished.
Details
pull request validation (sanity) Build finished.
Details

@gwynne gwynne deleted the gwynne:patch-2 branch Aug 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.