From: Jarkko Hietaniemi Date: Thu, 13 May 1999 13:51:44 +0000 (+0000) Subject: Add HAS_MEMCHR and make memchr into a cpp macro if it already isn't. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0f27ced10277587fa0b28dfb8021d0d6a60aa18b;p=p5sagit%2Fp5-mst-13.2.git Add HAS_MEMCHR and make memchr into a cpp macro if it already isn't. p4raw-id: //depot/cfgperl@3410 --- diff --git a/Configure b/Configure index 4a9ea70..890bfd4 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Thu May 13 15:54:16 EET DST 1999 [metaconfig 3.0 PL70] +# Generated on Thu May 13 16:42:40 EET DST 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <try.c </dev/null + if $test ! -s try.out -a "X$?" = X42; then + output=-DTRY_FPUTC + fi + fi + case "$output" in + '') + set try -DTRY_FPRINTF + $rm -f try.out + if eval $compile_ok; then + ./try$exe_ext 2>/dev/null + if $test ! -s try.out -a "X$?" = X42; then + output=-DTRY_FPRINTF + fi + fi + ;; + esac +fi : check for fflush NULL behaviour case "$fflushNULL" in -'') set try -DTRY_FFLUSH_NULL +'') set try -DTRY_FFLUSH_NULL $output $rm -f try.out if eval $compile_ok; then ./try$exe_ext 2>/dev/null if $test -s try.out -a "X$?" = X42; then fflushNULL="`$cat try.out`" fi - $rm -f core try.core core.try.* fi + $rm -f core try.core core.try.* case "$fflushNULL" in x) cat >&4 </dev/null if $test -s try.out -a "X$?" = X42; then fflushall="`$cat try.out`" fi - $rm -f core try.core core.try.* fi + $rm -f core try.core core.try.* case "$fflushall" in x) cat >&4 <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #define LONGLONGSIZE $longlongsize /**/ #endif +/* HAS_MEMCHR: + * This symbol, if defined, indicates that the memchr routine is available + * to locate characters within a C string. + */ +#$d_memchr HAS_MEMCHR /**/ + /* HAS_MMAP: * This symbol, if defined, indicates that the mmap system call is * available to map a file into memory. diff --git a/perl.h b/perl.h index b6fe805..cee3d09 100644 --- a/perl.h +++ b/perl.h @@ -502,6 +502,12 @@ Free_t Perl_mfree _((Malloc_t where)); # endif #endif +#ifndef memchr +# ifndef HAS_MEMCHR +# define memchr(s,c,n) ninstr((char*)(s), ((char*)(s)) + n, &(c), &(c) + 1) +# endif +#endif + #ifndef HAS_BCMP # ifndef bcmp # define bcmp(s1,s2,l) memcmp(s1,s2,l)