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

Nil doesn't work well with macOS, mixed objectivec++ and c++ #1

Open
dimitre opened this issue Mar 10, 2023 · 2 comments
Open

Nil doesn't work well with macOS, mixed objectivec++ and c++ #1

dimitre opened this issue Mar 10, 2023 · 2 comments

Comments

@dimitre
Copy link

dimitre commented Mar 10, 2023

Hello, it seems Nil is a reserved word in objectivec++
Any workaround, like renaming the Nil? Thanks

/Volumes/tool/ofw/apps/pgd/ofxProjectGenerator/src/uuidxx/src/uuidxx.h:11:3: error: expected identifier
                Nil,
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/objc.h:98:16: note: expanded from macro 'Nil'
#   define Nil nullptr
@mqudsi
Copy link
Member

mqudsi commented Mar 11, 2023

We can undef Nil at the top of the header file and restore it at the bottom and add an alias for it for ObjC users like Nill or something.

mqudsi added a commit that referenced this issue Mar 11, 2023
mqudsi added a commit that referenced this issue Mar 11, 2023
Protect against Objective C's `#define Nil nullptr` by temporarily
suppressing the Nil define and providing an alias for Nil ("Nill") to
support calling from Objective C contexts.

See #1
@mqudsi
Copy link
Member

mqudsi commented Mar 11, 2023

Can you try this? #2

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