Summary: | Build error with Gtk port on Mac OS X (r29781) | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Randall Wood <alexandriasoftware> | ||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | dobey, mrowe | ||||
Priority: | P2 | Keywords: | Gtk | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Mac | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
Randall Wood
2008-01-24 23:19:23 PST
I'm curious what is pulling in the QuickDraw headers. It may or may not be a bug that they are being pulled in when building the Gtk port on Mac OS X. One way to find out where they are being included from is to intentionally introduce an error into the header. For example, you could edit: /System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h and add a "#error Why am I here?" line somewhere near the beginning. Then when you build, GCC will emit an error which will mention which file is including the one triggering the error. Adding the error message results in: ...[blah blah blah]... In file included from /System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h:42, from /System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:30, from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:24, from ./JavaScriptCore/bindings/npapi.h:84, from ./JavaScriptCore/bindings/npruntime.h:76, from ./JavaScriptCore/bindings/npruntime_internal.h:28, from ./JavaScriptCore/bindings/NP_jsobject.h:31, from WebCore/page/Frame.cpp:70: /System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:1:2: error: #error Why am I here? /opt/local/include/X11/X.h:108: error: conflicting declaration 'typedef XID Cursor' /System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:270: error: 'Cursor' has a previous declaration as 'typedef struct Cursor Cursor' Thanks! So the problem would seem to be that both XP_MAC and XP_UNIX are defined on Mac OS X. This pulls in both Quickdraw.h and Xlib.h, which have conflicting definitions for Cursor. I'm guessing that for the Gtk port on Mac OS X, we probably don't want XP_MAC defined at all. Whether or not XP_UNIX is defined should depend on whether you're using the X11 or "native" version of Gtk. It might be as simple as changing: #if defined(__APPLE_CC__) && !defined(__MACOS_CLASSIC__) to: #if defined(__APPLE_CC__) && !defined(__MACOS_CLASSIC__) && !defined(XP_UNIX) I'm a little wary of changing npapi.h though as it's technically an API header, but a simple change like this is unlikely to cause problems. (In reply to comment #3) > I'm guessing that for the Gtk port on Mac OS X, we probably don't want XP_MAC > defined at all. Whether or not XP_UNIX is defined should depend on whether > you're using the X11 or "native" version of Gtk. We don't want XP_MAC or XP_UNIX defined I don't think. In fact, XP_UNIX only gets defined with the qmake build, when the GTK+ port is being built against X11. Is this problem occurring with the autotools build? Are you sure that the GTK+ you're building against, isn't using X11? I've just verified that the one-line change I suggested resolves this issue when building the Gtk port on Mac OS X. Created attachment 18690 [details]
Patch
Comment on attachment 18690 [details]
Patch
Looks good. r=me
|