<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39849 >
On Fri, 9 Nov 2007 22:26:56 -0800 Jason Dorje Short wrote: > Jason Dorje Short wrote: > > > > William Allen Simpson wrote: > >> > >> Naive trunk implementation: > > > > Naive is fine but you forgot to add the check to configure.ac. Attached > > patch does that. > > > > But now it still won't compile, and I don't understand why. > > Still strange. > > Delving into the preprocessor, if I just throw a -E on to the above line > the resulting file has no prototype for the function at all. Yet it is > clearly present in the header, surrounded by #ifdef __USE_GNU which is > presumably being left undefined somehow in compilation while it was > defined properly during the configure check. > > I suppose I could upload my string.h if anyone has any bright ideas. Doesn't #define _GNU_SOURCE required before including <string.h> to use strcasestr()? (Or have I read man 3 strcasestr wrongly?) Well, it works for me if I apply attached patch. (Note, that placing #define right before #include <string.h> gives no effect.) -- Thanks, evyscr
Index: utility/support.c =================================================================== --- utility/support.c (revision 14083) +++ utility/support.c (working copy) @@ -41,6 +41,10 @@ #include <config.h> #endif +#ifdef HAVE_STRCASESTR +#define _GNU_SOURCE +#endif + #include <assert.h> #include <ctype.h> #include <errno.h>
_______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev