Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Issue 208333020: [Mac] Rely on science, not chance, to get the proper definition of the macro (Closed)

Created:
6 years, 9 months ago by Mark Mentovai
Modified:
6 years, 9 months ago
Reviewers:
Nico, dcheng, eseidel
CC:
blink-reviews, jamesr, krit, dsinclair, jbroman, danakj, Rik, Stephen Chennney, pdr., rwlbuis, eseidel, Andre, Nico
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

[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 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=169976

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -37 lines) Patch
M Source/platform/geometry/FloatPoint.h View 2 chunks +3 lines, -5 lines 0 comments Download
M Source/platform/geometry/FloatRect.h View 2 chunks +4 lines, -5 lines 0 comments Download
M Source/platform/geometry/FloatSize.h View 2 chunks +3 lines, -6 lines 0 comments Download
M Source/platform/geometry/IntPoint.h View 2 chunks +4 lines, -5 lines 0 comments Download
M Source/platform/geometry/IntRect.h View 3 chunks +4 lines, -6 lines 0 comments Download
M Source/platform/geometry/IntSize.h View 2 chunks +3 lines, -5 lines 0 comments Download
M Source/web/mac/WebSubstringUtil.mm View 1 chunk +0 lines, -5 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Mark Mentovai
6 years, 9 months ago (2014-03-24 21:27:34 UTC) #1
eseidel
lgtm, but you may want a more up-to-date-on-mac reviewer than I.
6 years, 9 months ago (2014-03-24 21:30:07 UTC) #2
Mark Mentovai
What’s the most state-of-the-art choice in Blink Mac reviewers nowadays?
6 years, 9 months ago (2014-03-24 21:31:22 UTC) #3
eseidel
I had figured you'd know the answer to that question. :) I always assume that ...
6 years, 9 months ago (2014-03-24 21:36:27 UTC) #4
Mark Mentovai
All right, then Nico! (I thought there might have been more of a Blink specialist ...
6 years, 9 months ago (2014-03-24 21:39:51 UTC) #5
Nico
We have a prefix header too, but only for core: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/core.gyp&l=420 We tried removing it ...
6 years, 9 months ago (2014-03-25 18:05:05 UTC) #6
Mark Mentovai
The CQ bit was checked by mark@chromium.org
6 years, 9 months ago (2014-03-25 18:20:18 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mark@chromium.org/208333020/1
6 years, 9 months ago (2014-03-25 18:20:26 UTC) #8
commit-bot: I haz the power
6 years, 9 months ago (2014-03-25 19:32:47 UTC) #9
Message was sent while issue was closed.
Change committed as 169976

Powered by Google App Engine
This is Rietveld 408576698