[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AC_REPLACE_FUNCS and function prototypes
From: |
Masao Yonenaga |
Subject: |
AC_REPLACE_FUNCS and function prototypes |
Date: |
Sat, 19 Aug 2006 15:54:40 +0900 |
Hi,
I want to use a non-standard function like memrchr(). So I added:
AC_REPLACE_FUNCS(memrchr)
in configure.ac, and to prevent warnings, add
#ifndef HAVE_MEMRCHR
extern void *memrchr(const void *, int, size_t);
#endif
in a header file.
Now, I was able to compile it on platforms which have no memrchr()
function in libc. But on Linux (glibc), I got a warning like this:
warning: implicit declaration of function `memrchr'
because the memrchr() declaration in string.h is protected by #ifdef
__USE_GNU. How can I handle this situation properly? I want to avoid
unconditionally defining _GNU_SOURCE because its side effects are
unpredictable.
Regards,
--
Yonenaga Masao
- AC_REPLACE_FUNCS and function prototypes,
Masao Yonenaga <=