Re: Difference between NSPoint, NSSize, NSRect and the CG Versions

Quincey Morris

On Aug 31, 2017, at 14:07 , Steve Christensen <punster@...> wrote:

Regarding NSPoint, I see it defined as

typedef CGPoint NSPoint;

so its x and y fields will be CGFloats.

Opening up a macOS project and looking at the definition of NSPoint, I see:


typedef CGPoint NSPoint;


typedef struct _NSPoint {
    CGFloat x;
    CGFloat y;
} NSPoint;


So, it was the same size as CGPoint, but a different struct name, which was enough to create an ABI incompatibility. You could opt into the new typedef for 32-bit by using NS_BUILD_32_LIKE_64.

Join to automatically receive all group messages.