-#ifndef HAVE_MEMRCHR
- /* Actually, I think this is a GNU extension only */
- void * lutil_memrchr(const void *b, int c, size_t len);
-#undef memrchr
-#define memrchr lutil_memrchr
+void *(lutil_memrchr)(const void *b, int c, size_t n);
+/* GNU extension (glibc >= 2.1.91), only declared when defined(_GNU_SOURCE) */
+#if defined(HAVE_MEMRCHR) && defined(_GNU_SOURCE)
+#define lutil_memrchr(b, c, n) memrchr(b, c, n)