After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 601708 - Old definition in gtkprintbackendcups.c
Old definition in gtkprintbackendcups.c
Status: RESOLVED NOTABUG
Product: gtk+
Classification: Platform
Component: Printing
2.18.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-11-12 15:29 UTC by Shawn
Modified: 2009-11-12 23:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch fix for OS X Snow Leopard CUPS backend (1.22 KB, patch)
2009-11-12 16:02 UTC, Shawn
none Details | Review

Description Shawn 2009-11-12 15:29:56 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);
         }
     }
 }
Comment 1 Javier Jardón (IRC: jjardon) 2009-11-12 15:40:30 UTC
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.
Comment 2 Shawn 2009-11-12 16:02:13 UTC
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
Comment 3 Shawn 2009-11-12 16:02:46 UTC
I am new at this... so let me know if I got it wrong.
Comment 4 André Klapper 2009-11-12 16:10:13 UTC
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. :-)
Comment 5 Javier Jardón (IRC: jjardon) 2009-11-12 16:20:51 UTC
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
Comment 6 Shawn 2009-11-12 18:04:08 UTC
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...
Comment 7 Shawn 2009-11-12 18:04:33 UTC
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...
Comment 8 Javier Jardón (IRC: jjardon) 2009-11-12 18:19:28 UTC
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.
Comment 9 Shawn 2009-11-12 23:40:32 UTC

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.