[2982] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

Re: [PATCH] Protect memrchr prototype by !HAVE_DECL_MEMCHR instead

daemon@ATHENA.MIT.EDU (David A Benjamin)
Sat Mar 19 22:47:09 2011

Date: Sat, 19 Mar 2011 22:47:06 -0400 (EDT)
From: David A Benjamin <davidben@MIT.EDU>
To: Anders Kaseorg <andersk@mit.edu>
cc: barnowl-dev@mit.edu
In-Reply-To: <alpine.DEB.2.02.1103192239300.4468@dr-wily.mit.edu>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---1257051904-161632475-1300589226=:25741
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

Sigh.

LGTM, assuming it does in fact build.

(Mind also adding include guards while you're messing with the file? I=20
apparently forgot them.)

David

On Sat, 19 Mar 2011, Anders Kaseorg wrote:

> This fixes
> viewwin.c:393:7: warning: implicit declaration of function =E2=80=98memrc=
hr=E2=80=99
> on platforms where PERL_CFLAGS doesn=E2=80=99t contain -D_GNU_SOURCE.
>
> !HAVE_MEMRCHR means that memrchr is undefined at link time, so we need
> to provide our own implementation; but !HAVE_DECL_MEMRCHR means that
> memrchr is not prototyped at compile time, so we need to provide our
> own prototype.
>
> http://lists.gnu.org/archive/html/bug-autoconf/2008-12/msg00037.html
>
> Signed-off-by: Anders Kaseorg <andersk@mit.edu>
> ---
> compat/compat.h |    4 ++--
> configure.ac    |    1 +
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/compat/compat.h b/compat/compat.h
> index 8ad61e6..05c40c9 100644
> --- a/compat/compat.h
> +++ b/compat/compat.h
> @@ -2,6 +2,6 @@
>
> #include <stddef.h>
>
> -#ifndef HAVE_MEMRCHR
> +#if !HAVE_DECL_MEMRCHR
> void *memrchr(const void *s, int c, size_t n);
> -#endif  /* HAVE_MEMRCHR */
> +#endif  /* !HAVE_DECL_MEMRCHR */
> diff --git a/configure.ac b/configure.ac
> index 0a200ae..e40e474 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -158,6 +158,7 @@ if test "x${HAVE_ZIP}" =3D "xno"; then
> fi
>
> AC_CONFIG_LIBOBJ_DIR([compat])
> +AC_CHECK_DECLS([memrchr])
> AC_REPLACE_FUNCS([memrchr])
>
> AC_CONFIG_FILES([Makefile compat/Makefile libfaim/Makefile perl/Makefile =
perl/modules/Makefile])
> --=20
> 1.7.4.1
>
>
---1257051904-161632475-1300589226=:25741--

home help back first fref pref prev next nref lref last post