I want to write an inline function, but I get an error. How can I fix it?
Error information:
Undefined symbo
I think XYInRect() needs to be known prior to being used. Move the function definition to some place in the file before you call it.
Clang defaults to C99 and not GNU sematics, which means a raw inline is different from both static inline and extern inline.
In particular, a raw inline means that the function still has external linkage, but the inline definition does not provide the external one (you'd need extern inline for that).
What this means is that you need an additional extern definition in a different translation unit or linking will fail. However, you're probably looking for static inline.
Also would suggest using CGRectContainsPoint