Changeset 2cbe7c3 for compat/compat.h


Ignore:
Timestamp:
Mar 19, 2011, 11:19:29 PM (13 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
4dde585
Parents:
41f0cf3
git-author:
Anders Kaseorg <andersk@mit.edu> (03/19/11 22:28:30)
git-committer:
Anders Kaseorg <andersk@mit.edu> (03/19/11 23:19:29)
Message:
Protect memrchr prototype by !HAVE_DECL_MEMCHR instead of !HAVE_MEMCHR

This fixes
viewwin.c:393:7: warning: implicit declaration of function ‘memrchr’
on platforms where PERL_CFLAGS doesn’t 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 declared 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>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • compat/compat.h

    r12a6616 r2cbe7c3  
    33#include <stddef.h>
    44
    5 #ifndef HAVE_MEMRCHR
     5#if !HAVE_DECL_MEMRCHR
    66void *memrchr(const void *s, int c, size_t n);
    7 #endif  /* HAVE_MEMRCHR */
     7#endif  /* !HAVE_DECL_MEMRCHR */
Note: See TracChangeset for help on using the changeset viewer.