GNOME Bugzilla – Bug 601708
Old definition in gtkprintbackendcups.c
Last modified: 2009-11-12 23:40:32 UTC
I have been working on OS X Snow Leopard and in order to get the Gtk+ to compile I had to make the following patch to gtkprintbackendcups.c The compiler complains about dereferencing pointer to incomplete type on line 930. --- gtkprintbackendcups.c 2009-11-11 12:41:33.000000000 -0800 +++ gtkprintbackendcups.old 2009-11-11 12:38:45.000000000 -0800 @@ -889,9 +889,12 @@ else dispatch->data_poll->events = 0; - dispatch->data_poll->fd = httpGetFd (dispatch->request->http); - - g_source_add_poll (source, dispatch->data_poll); +#ifdef HAVE_CUPS_API_1_2 + dispatch->data_poll->fd = httpGetFd (dispatch->request->http); +#else + dispatch->data_poll->fd = dispatch->request->http->fd; +#endif + g_source_add_poll (source, dispatch->data_poll); } } }
Hello Shawn, The patch looks good but could you fix the indentation, please? Then attach the patch instead paste, so bugzilla can detect it for future searches and statistics. Thank you very much.
Created attachment 147586 [details] [review] Patch fix for OS X Snow Leopard CUPS backend This is a fix for the cups printing backend on OS X Snow Leopard
I am new at this... so let me know if I got it wrong.
Patches directly against the Git master checkout by using "git format-patch HEAD^" are even more welcome, see http://live.gnome.org/Git/Developers . But yours is fine too. Thanks for it. :-)
Hey Shawn :), Thank you for the patch. What version of GTK+ are you using? This issue seems that was fixed in this commit: http://git.gnome.org/cgit/gtk+/commit/?id=f7d932d49999447a3a5236aa885301fbc5bbcb28 and should be available in GTK+ 2.12 Set status to NEEDINFO
Ah yes... Like I mentioned before, the patch in the comment is backwards :P Still trying to learn this stuff... The patch file actually removes the ifdef and leaves the line as such. dispatch->data_poll->fd = httpGetFd (dispatch->request->http); I am using Gtk+ 2.18.2, but the definition no longer exists, or at least I have not been able to find it. In any case I believe the correct way is to use the httpGetFp on the object instead of calling its member directly. Since HAVE_CUPS_API_1_2 does not seem to be defined on OS X Snow Leopard it incorrectly tries to use the direct member access instead of the httpGetFp function. Sorry about the bad patch comment. The patch file is correct though...
Hello Shawn, your patch can not be applied because the #ifdef is necessary for compatibility reasons. Check that you already have the development cups files installed on your system. If they are correctly installed, then the error see to be in the configure.in file, when it try to detect what cups version you have: http://git.gnome.org/cgit/gtk+/tree/configure.in#n1866 I don't have a mac so I can't test here.
Sorry guys.... Your right this is not a bug at all, at least not in gtk. It had to do with the jhbuild script which setup the environment for OS X. Jralls has done a masterful job of fixing it, and now I have no issues building the entire toolset on OS X Snow Leopard, using the gtk+-2.18 and the 10.5 SDK building for i386. I know this is not 64bit, but as I understand there is some work to be done. Thanks for all the time and patience while I get my hands around all this.