4 ms·
A .h file can be compiled as C, C++, or Objective-C. Isn't that how single-file libraries usually work?
by btrask 10y ago
A .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.