97 ms·
I haven't looked at tigr yet (it seems interesting!) but could you just use '#ifdef __OBJC__'?
by btrask 10y ago
I haven't looked at tigr yet (it seems interesting!) but could you just use '#ifdef __OBJC__'?
- dmytroi 10y agoNot really, because everything is C/C++ there by means files are .c, .cpp and not .m or .mm, its a bit tricky from build system point of view to treat the file with extension .c/.cpp as Objective-C.
- btrask 10y agoA .h file can be compiled as C, C++, or Objective-C. Isn't that how single-file libraries usually work?
- dmytroi 10y agoYes, and this .h file will be used from .c/.cpp because looks like it's way to bulky to add additional .m/.mm file just for OSX/iOS case when creating cross platform applications. Check tigr - it's possible to run exactly the same C/C++ code on Windows and OSX without any changes at all.
- comex 10y agoSince Objective-C is a true superset of C (unlike C++) and there's also Objective-C++, you can just tell the compiler to compile all .c/.cpp as if they were .m/.mm. That is, if you can figure out how to coax your build system to pass the right flags.