add HAVE_STRNSTR
This commit is contained in:
parent
041708f643
commit
0f56b68eac
21
configure
vendored
21
configure
vendored
@ -474,6 +474,27 @@ else
|
|||||||
fi
|
fi
|
||||||
rm -f _$func.c _$func
|
rm -f _$func.c _$func
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check for strnstr().
|
||||||
|
func=strnstr
|
||||||
|
printf "Checking for $func() ... "
|
||||||
|
cat <<EOF > _$func.c
|
||||||
|
#include <string.h>
|
||||||
|
int main(void) {
|
||||||
|
const char big[] = "foo";
|
||||||
|
const char little[] = "f";
|
||||||
|
strnstr(big, little, 3);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
if $XCC _$func.c -o _$func 2>/dev/null; then
|
||||||
|
echo yes.
|
||||||
|
echo "CPPFLAGS += -DHAVE_STRNSTR" >>$CONFIG_MK
|
||||||
|
else
|
||||||
|
echo no.
|
||||||
|
fi
|
||||||
|
rm -f _$func.c _$func
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check for humanize_number().
|
# Check for humanize_number().
|
||||||
func=humanize_number
|
func=humanize_number
|
||||||
|
@ -444,6 +444,8 @@ fetch_cache_put(conn_t *conn, int (*closecb)(conn_t *))
|
|||||||
|
|
||||||
|
|
||||||
#ifdef WITH_SSL
|
#ifdef WITH_SSL
|
||||||
|
|
||||||
|
#ifndef HAVE_STRNSTR
|
||||||
/*
|
/*
|
||||||
* Find the first occurrence of find in s, where the search is limited to the
|
* Find the first occurrence of find in s, where the search is limited to the
|
||||||
* first slen characters of s.
|
* first slen characters of s.
|
||||||
@ -468,6 +470,7 @@ strnstr(const char *s, const char *find, size_t slen)
|
|||||||
}
|
}
|
||||||
return ((char *)__UNCONST(s));
|
return ((char *)__UNCONST(s));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert characters A-Z to lowercase (intentionally avoid any locale
|
* Convert characters A-Z to lowercase (intentionally avoid any locale
|
||||||
|
Loading…
x
Reference in New Issue
Block a user