Re: gnome-print problems



On Thu, Sep 23, 1999 at 02:48:25PM +0800, James Henstridge wrote:

> It looks like one of the structure members in the xmlParserCtxt structure
> of libxml is called errno.  Your C library defines this as a macro (for
> threading purposes), which is causing the error while parsing the header.

  Yep, gnome-xml/parser.h defines it. Found this in the Changelog:

Wed Sep 22 11:40:31 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>

        * parser.h: modified the parser context struct to regain 1.4.0
                    binary compatibility
        * parser.c, xml-error.h: added errno ot teh context and defined
                    a set of errors values with update of errno

> The two possible fixes are (1) change the name of the structure member in
> libxml or (2) include the libxml headers before errno.h in gnome-print.
> It is worth fixing this because quite a lot of people have C libraries
> that define errno as a macro.

  Yeah, I'd say so, just about every major Linux distribution is glibc based
these days :-) Not much of a programmer myself so I don't know which way is
the best, but a 'grep "errno" *' in the gmone-xml sources spits back a 
couple of screenfulls so I tried the second approach which was pretty trivial
(more my style :-). With the following diff it compiled with a few warnings
but no errors and nothing related to the original error.

<snip>
--- gnome-font-install.c.ORIG   Mon Sep 13 14:21:30 1999
+++ gnome-font-install.c        Thu Sep 23 00:28:23 1999
@@ -34,9 +34,9 @@
 #include <dirent.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#include <errno.h>
 #include <gnome-xml/tree.h>
 #include <gnome-xml/parser.h>
+#include <errno.h>
 #include "config.h"
 
 /* This program does not delete everything it allocates since it's

<snip>
--
Bill Gates is not god and Microsoft is not heaven.

Mike Hall <mhall@riverside.org>, ICQ: #37292579, http://www.riverside.org
System Administrator (MH993) (*nix, OS/2 certified - C, Perl, CGI hacker)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]