Hi,
On Sat, Nov 18, 2000 at 10:52:59PM +0100, Jochen Eisinger wrote:
> AC_TRY_COMPILE([
> #include <string.h>],[char *c=index(" ",' ')],,CPPFLAGS="${CPPFLAGS}
> -DNEED_STRINGS_H")
Doesn't work because the compilers will use int as return type in this
case and just put out a warning about int assigned to char *. The
following works, however:
AC_MSG_CHECKING([for string.h containing index])
AC_TRY_COMPILE([
#include <string.h>
],[
char a[] = "a";
int c=index(" ",' ') - a
],echo "yes",
[CPPFLAGS="${CPPFLAGS} -DNEED_STRINGS_H" ; echo "no"])
Not exactly elegant :-)
> #ifdef NEED_STRINGS_H
> # include <strings.h>
> #else
> # include <string.h>
> #endif
>
>
> should work =)
Not tested but I don't see why not. Change it and I will see if it
works on all platforms :-)
Bye,
Henning
-- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
This archive was generated by hypermail 2b29 : Sat Nov 18 2000 - 16:09:10 PST