[Mac] Rely on science, not chance, to get the proper definition of the macro...
[Mac] Rely on science, not chance, to get the proper definition of the macro NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES. NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES is used in {Int,Float}{Point,Size,Rect}.h to determine whether to provide distinct conversion constructors and operators for Foundation NS{Point,Size,Rect} types in addition to the CoreGraphics CG{Point,Size,Rect} types. When this macro is defined (as in 64-bit Mac OS X), the NS and CG types are identical and no additional overloads are needed. When not defined (as in 32-bit Mac OS X), the types are distinct and additional overrides are needed for the NS types. This macro is set (or not) by <Foundation/NSGeometry.h>. It is an error to consider this macro without first #importing this header or its umbrella, <Foundation/Foundation.h> or <Cocoa/Cocoa.h>. It is also an error to #import these headers from non-Objective-C code, but in that case, it is impossible to correctly use the NS types. The net effect is that the overloads for the distinct NS types will available in Objective-C translation units when the types are in fact distinct from the CG ones, and not available in non-Objective-C translation units where they wouldn't be useful anyway, even if the types are distinct. Where the types are not distinct, the conversion constructor and operator for CG types is able to handle NS ones as well. This backs out a previous hack fix for this problem, Blink r169826. BUG=355576 TEST=compile, both 32-bit and 64-bit Review URL: https://codereview.chromium.org/208333020 git-svn-id: svn://svn.chromium.org/blink/trunk@169976 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment