# $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$$ <<EOF
d_mblen=''
d_mbstowcs=''
d_mbtowc=''
+d_memchr=''
d_memcmp=''
d_memcpy=''
d_memmove=''
set mbtowc d_mbtowc
eval $inlibc
+: see if memchr exists
+set memchr d_memchr
+eval $inlibc
+
: see if memcmp exists
set memcmp d_memcmp
eval $inlibc
#$d_sysconf HAS_SYSCONF
int main() {
FILE* p = fopen("try.out", "w");
+#ifdef TRY_FPUTC
fputc('x', p);
+#else
+# ifdef TRY_FPRINTF
+ fprintf(p, "x");
+# endif
+#endif
#ifdef TRY_FFLUSH_NULL
fflush(NULL);
#endif
_exit(42);
}
EOCP
+: first we have to find out how _not_ to flush
+if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
+ output=''
+ set try -DTRY_FPUTC
+ $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_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 <<EOM
Your fflush(NULL) works okay.
esac
: check for fflush all behaviour
case "$fflushall" in
-'') set try -DTRY_FFLUSH_ALL
+'') set try -DTRY_FFLUSH_ALL $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
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 <<EOM
Flushing explicitly all the stdio streams works.
d_mblen='$d_mblen'
d_mbstowcs='$d_mbstowcs'
d_mbtowc='$d_mbtowc'
+d_memchr='$d_memchr'
d_memcmp='$d_memcmp'
d_memcpy='$d_memcpy'
d_memmove='$d_memmove'
#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.
# 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)