Complete.Org: Mailing Lists: Archives: freeciv-dev: November 1998:
Re: [Freeciv-Dev] Linker error?
Home

Re: [Freeciv-Dev] Linker error?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] Linker error?
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sat, 7 Nov 1998 14:04:12 +1100

I submitted a patch partially included below, to allow compilation on a 
system where configure didn't find strerror.
Apparently the patch worked, but as it stands its probably not suitable
for inclusion to CVS, because it doesn't work with Imakefile and
Makefile.noimake.  Well, that is, it doesn't use the real strerror,
in those cases because they don't define HAVE_STRERROR (naturally).  

Any suggestions about getting around this?  I suppose either ch
anging the tests in mystrerror to try and see if we're using configure, 
or have the non-configure makefiles (customizably) define HAVE_STRERROR 
themselves, or ... ?

-- David

> --_----------=_91008841620600
> Content-Disposition: inline; filename="mystrerror.diff"

> diff -u -r --exclude-from exclude freeciv-cvs/common/shared.c 
> freeciv-mod/common/shared.c
> --- freeciv-cvs/common/shared.c       Thu Oct 29 20:22:12 1998
> +++ freeciv-mod/common/shared.c       Tue Nov  3 21:11:46 1998
> @@ -253,6 +253,20 @@
>     return mystrcasecmp(*((char **)first), *((char **)second));
>  }
>  
> +/***************************************************************
> +...
> +***************************************************************/
> +char *mystrerror(int errnum)
> +{
> +#ifdef HAVE_STRERROR
> +  return strerror(errnum);
> +#else
> +  static char buf[64];
> +  sprintf(buf, "error %d (compiled without strerror())", errnum);
> +  return buf;
> +#endif
> +}
> +
>  
>  /*************************************************************************
>     The following random number generator can be found in _The Art of 



[Prev in Thread] Current Thread [Next in Thread]