uuidxx icon indicating copy to clipboard operation
uuidxx copied to clipboard

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

Open dimitre opened this issue 2 years ago • 2 comments

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

dimitre avatar Mar 10 '23 17:03 dimitre

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 avatar Mar 11 '23 18:03 mqudsi

Can you try this? https://github.com/neosmart/uuidxx/pull/2

mqudsi avatar Mar 11 '23 20:03 mqudsi