Re: Trouble compiling CVS with g++=3.2.2

From John R. McPherson
DateMon, 20 Jan 2003 18:18:18 +1300
Subject Re: Trouble compiling CVS with g++=3.2.2
In-Reply-To (33262-24-205-179-149-1043038201-squirrel-library-ucr-edu)
Gordon Paynter wrote:

> > gsdl/src/mgpp/lib/sysfuncs.h looks very suspicious, especially around
> > line 341 :)
> >
> > 337 #if ENABLE_NLS
> > 338 #include <libintl.h>
> > 339 #define _(Text) gettext (Text)
> > 340 #else
> > 341 #define textdomain(Domain)
> > 342 #define _(Text) Text
> > 342 #endif
>
> When I compile mgpp_passes the preprocessor must pick up the #define on
> line 341, and then later on loads libintl.h also and substituues
> textdomain into the extern char * declaraion above. Then libintl.h will
> be sent to g++ with "extern char * throw..." on line 81--which is
> consistent with the error message: "usr/include/libintl.h:81: parse error
> before `throw'".
>
> The obvious solution is to use a name other than textdomain for our
> #define. Does anyone have any prior knowledge of what it is or does?
> Also, are the files in mgpp/lib/*.h referenced outside the mgpp tree?
>
> If nobody else wants it, I'll fix it myself, later this week. I don't
> have a working gsdl on my laptop either at the moment due to Expat/perl
> library compatabilities in Debian unstable for ppc.

the lib/sysfunc.h stuff was an attempt by whoever wrote mg (or maybe mgpp)
to be portable across the different unixes. So maybe the "proper" solution
would be for configure to see if gettext is installed and define ENABLE_NLS
in config.h if it is. We can't rely on it as it is not a POSIX standard.

I guess the difference with recent gcc/g++ versions is that libintl.h is
now included by more of the other header files.

John