[webkit-reviews] review requested: [Bug 57239] Use forward class declaration instead of including header : [Attachment 87153] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 28 09:26:43 PDT 2011


David Kilzer (ddkilzer) <ddkilzer at webkit.org> has asked  for review:
Bug 57239: Use forward class declaration instead of including header
https://bugs.webkit.org/show_bug.cgi?id=57239

Attachment 87153: Patch
https://bugs.webkit.org/attachment.cgi?id=87153&action=review

------- Additional Comments from David Kilzer (ddkilzer) <ddkilzer at webkit.org>
Reviewed by NOBODY (OOPS!).

Adding a "using namespace WebCore;" statement in a header may
cause issues when <WebCore/Length.h> is included before
<CoreText/CoreText.h>.

Length.h defines the LengthType enum with a 'Fixed' value.
CoreText.h includes MacTypes.h, which has a
"typedef SInt32 Fixed;" statement, and then CoreText.h includes
other headers that also use 'Fixed', but expect the typedef to
be defined, not the enum.  If another header includes
"using namespace WebCore;" before CoreText.h, the
following compiler errors result (paths abbreviated):

CoreText.framework/Headers/SFNTLayoutTypes.h:689: error: reference to 'Fixed'
is ambiguous
MacTypes.h:184: error: candidates are: typedef SInt32 Fixed
Length.h:37: error:		    WebCore::LengthType WebCore::Fixed
SFNTLayoutTypes.h:689: error: 'Fixed' does not name a type

* platform/mac/HTMLConverter.h: Use forward declaration of
DocumentLoader class instead of including header.  Remove the
unused "using namespace WebCore;" statement.
---
 2 files changed, 31 insertions(+), 3 deletions(-)


More information about the webkit-reviews mailing list