Summary: - memrchr is GNU + Linux specific, it turns out
Test Plan: - compiled on FreeBSD, contbuild
Reviewed By: delong.j@fb.com
FB internal diff:
D900935
return pos == nullptr ? std::string::npos : pos - haystack.data();
}
-#ifdef _GNU_SOURCE // memrchr is a GNU extension
+#if FOLLY_HAVE_MEMRCHR
template <>
inline size_t rfind(const Range<const char*>& haystack, const char& needle) {
auto pos = static_cast<const char*>(
return pos == nullptr ? std::string::npos : pos - haystack.data();
}
-#ifdef _GNU_SOURCE // memrchr is a GNU extension
+#if FOLLY_HAVE_MEMRCHR
template <>
inline size_t rfind(const Range<const unsigned char*>& haystack,
const unsigned char& needle) {
pthread_yield \
rallocm \
malloc_size \
- malloc_usable_size])
+ malloc_usable_size \
+ memrchr])
if test "$ac_cv_func_pthread_yield" = "no"; then
AC_CHECK_HEADERS([sched.h])