]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- use memcpy and memset in md5.c instead of MD5_memcpy and MD5_memset
authorrousskov <>
Wed, 3 Jun 1998 22:35:33 +0000 (22:35 +0000)
committerrousskov <>
Wed, 3 Jun 1998 22:35:33 +0000 (22:35 +0000)
  if we can

configure
configure.in
include/autoconf.h.in
lib/md5.c

index 76e664b5afdae6545a0867d2479a532621334595..305f2d4943236a12d153204fa26515e9ca83d62a 100755 (executable)
--- a/configure
+++ b/configure
@@ -3523,6 +3523,7 @@ for ac_func in \
        mallopt \
        memcpy \
        memmove \
+       memset \
        mktime \
        mstats \
        random \
@@ -3546,12 +3547,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3550: checking for $ac_func" >&5
+echo "configure:3551: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3555 "configure"
+#line 3556 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3574,7 +3575,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3612,12 +3613,12 @@ case "$host" in
                ;;
        *)
                echo $ac_n "checking for poll""... $ac_c" 1>&6
-echo "configure:3616: checking for poll" >&5
+echo "configure:3617: checking for poll" >&5
 if eval "test \"`echo '$''{'ac_cv_func_poll'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3621 "configure"
+#line 3622 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char poll(); below.  */
@@ -3640,7 +3641,7 @@ poll();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_poll=yes"
 else
@@ -3663,7 +3664,7 @@ fi
 esac
 
 echo $ac_n "checking if setresuid is implemented""... $ac_c" 1>&6
-echo "configure:3667: checking if setresuid is implemented" >&5
+echo "configure:3668: checking if setresuid is implemented" >&5
 if eval "test \"`echo '$''{'ac_cv_func_setresuid'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3671,7 +3672,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3675 "configure"
+#line 3676 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -3684,7 +3685,7 @@ else
   }
   
 EOF
-if { (eval echo configure:3688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_setresuid="yes"
 else
@@ -3718,13 +3719,13 @@ if test -z "$USE_GNUREGEX" ; then
     esac
 fi
 echo $ac_n "checking if GNUregex needs to be compiled""... $ac_c" 1>&6
-echo "configure:3722: checking if GNUregex needs to be compiled" >&5
+echo "configure:3723: checking if GNUregex needs to be compiled" >&5
 if test -z "$USE_GNUREGEX"; then
 if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then
        USE_GNUREGEX="yes"
 else
        cat > conftest.$ac_ext <<EOF
-#line 3728 "configure"
+#line 3729 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <regex.h>
@@ -3732,7 +3733,7 @@ int main() {
 regex_t t; regcomp(&t,"",0);
 ; return 0; }
 EOF
-if { (eval echo configure:3736: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   USE_GNUREGEX="no"
 else
@@ -3762,12 +3763,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3766: checking for $ac_func" >&5
+echo "configure:3767: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3771 "configure"
+#line 3772 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3790,7 +3791,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3818,12 +3819,12 @@ done
 
 
 echo $ac_n "checking Default FD_SETSIZE value""... $ac_c" 1>&6
-echo "configure:3822: checking Default FD_SETSIZE value" >&5
+echo "configure:3823: checking Default FD_SETSIZE value" >&5
 if test "$cross_compiling" = yes; then
   DEFAULT_FD_SETSIZE=256
 else
   cat > conftest.$ac_ext <<EOF
-#line 3827 "configure"
+#line 3828 "configure"
 #include "confdefs.h"
 
 #if HAVE_STDIO_H
@@ -3847,7 +3848,7 @@ main() {
 }
 
 EOF
-if { (eval echo configure:3851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   DEFAULT_FD_SETSIZE=`cat conftestval`
 else
@@ -3866,12 +3867,12 @@ EOF
 
 
 echo $ac_n "checking Maximum number of filedescriptors we can open""... $ac_c" 1>&6
-echo "configure:3870: checking Maximum number of filedescriptors we can open" >&5
+echo "configure:3871: checking Maximum number of filedescriptors we can open" >&5
 if test "$cross_compiling" = yes; then
   SQUID_MAXFD=256
 else
   cat > conftest.$ac_ext <<EOF
-#line 3875 "configure"
+#line 3876 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -3930,7 +3931,7 @@ main() {
 }
 
 EOF
-if { (eval echo configure:3934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_MAXFD=`cat conftestval`
 else
@@ -3956,12 +3957,12 @@ if test "$SQUID_MAXFD" -lt 512 ; then
 fi
 
 echo $ac_n "checking Default UDP send buffer size""... $ac_c" 1>&6
-echo "configure:3960: checking Default UDP send buffer size" >&5
+echo "configure:3961: checking Default UDP send buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_UDP_SO_SNDBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 3965 "configure"
+#line 3966 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -3980,7 +3981,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:3984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_UDP_SO_SNDBUF=`cat conftestval`
 else
@@ -3999,12 +4000,12 @@ EOF
 
 
 echo $ac_n "checking Default UDP receive buffer size""... $ac_c" 1>&6
-echo "configure:4003: checking Default UDP receive buffer size" >&5
+echo "configure:4004: checking Default UDP receive buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_UDP_SO_RCVBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 4008 "configure"
+#line 4009 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4023,7 +4024,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:4027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_UDP_SO_RCVBUF=`cat conftestval`
 else
@@ -4042,12 +4043,12 @@ EOF
 
 
 echo $ac_n "checking Default TCP send buffer size""... $ac_c" 1>&6
-echo "configure:4046: checking Default TCP send buffer size" >&5
+echo "configure:4047: checking Default TCP send buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_TCP_SO_SNDBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 4051 "configure"
+#line 4052 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4066,7 +4067,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:4070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_TCP_SO_SNDBUF=`cat conftestval`
 else
@@ -4085,12 +4086,12 @@ EOF
 
 
 echo $ac_n "checking Default TCP receive buffer size""... $ac_c" 1>&6
-echo "configure:4089: checking Default TCP receive buffer size" >&5
+echo "configure:4090: checking Default TCP receive buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_TCP_SO_RCVBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 4094 "configure"
+#line 4095 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -4109,7 +4110,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:4113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_TCP_SO_RCVBUF=`cat conftestval`
 else
@@ -4127,56 +4128,20 @@ cat >> confdefs.h <<EOF
 EOF
 
 
-if test "$ac_cv_func_snprintf" = "yes" ; then
-  echo $ac_n "checking what snprintf() returns when truncating""... $ac_c" 1>&6
-echo "configure:4133: checking what snprintf() returns when truncating" >&5
-  if test "$cross_compiling" = yes; then
-  SNPRINTF_TRUNC_RET=-1
-else
-  cat > conftest.$ac_ext <<EOF
-#line 4138 "configure"
-#include "confdefs.h"
-
-  #include <stdio.h>
-  main ()
-  {
-        char buf[10];
-       int x;
-        x = snprintf(buf, 10, "ABCDEFGHIJKLM");
-        fprintf (fopen("conftestval", "w"), "%d\n", x);
-       exit(0);
-  }
-  
-EOF
-if { (eval echo configure:4152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
-  SNPRINTF_TRUNC_RET=`cat conftestval`
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  SNPRINTF_TRUNC_RET=-1
-fi
-rm -fr conftest*
-fi
-
-  echo "$ac_t""$SNPRINTF_TRUNC_RET" 1>&6
-fi
-
 echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6
-echo "configure:4168: checking if sys_errlist is already defined" >&5
+echo "configure:4133: checking if sys_errlist is already defined" >&5
 if eval "test \"`echo '$''{'ac_cv_needs_sys_errlist'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4173 "configure"
+#line 4138 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 char *s = sys_errlist0;
 ; return 0; }
 EOF
-if { (eval echo configure:4180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_needs_sys_errlist="no"
 else
@@ -4198,16 +4163,16 @@ EOF
 fi
 
 echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6
-echo "configure:4202: checking for libresolv _dns_ttl_ hack" >&5
+echo "configure:4167: checking for libresolv _dns_ttl_ hack" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4204 "configure"
+#line 4169 "configure"
 #include "confdefs.h"
 extern int _dns_ttl_;
 int main() {
 return _dns_ttl_;
 ; return 0; }
 EOF
-if { (eval echo configure:4211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 cat >> confdefs.h <<\EOF
index 52b78c3a4e64fe7e24e0696aed7b5047211f283c..12e75a7b0ff85915ccc45a0edc4e9621c4e43790 100644 (file)
@@ -3,13 +3,13 @@ dnl  Configuration input file for Squid
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
 dnl
-dnl  $Id: configure.in,v 1.130 1998/05/28 16:07:36 wessels Exp $
+dnl  $Id: configure.in,v 1.131 1998/06/03 16:35:34 rousskov Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.130 $)dnl
+AC_REVISION($Revision: 1.131 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(cfgaux)
 
@@ -659,6 +659,7 @@ AC_CHECK_FUNCS(\
        mallopt \
        memcpy \
        memmove \
+       memset \
        mktime \
        mstats \
        random \
index 59a6f322720614a1aa240ac4e204da71e7671637..9ca1ad7aa52e36c458b68a14a7c34e7fd50dcd5d 100644 (file)
 /* Define if you have the memmove function.  */
 #undef HAVE_MEMMOVE
 
+/* Define if you have the memset function.  */
+#undef HAVE_MEMSET
+
 /* Define if you have the mktime function.  */
 #undef HAVE_MKTIME
 
index 243521404384d59042ee2592d8198e08b2e32f30..27f43318c5cb83e8b56f5a381bf5edd9539ae57c 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
  * and by the SNMP routines.
  */
 
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+
 #include "md5.h"
 
 /*
 static void MD5Transform(u_num32[4], unsigned char[64]);
 static void Encode(unsigned char *, u_num32 *, unsigned int);
 static void Decode(u_num32 *, unsigned char *, unsigned int);
+
+#if HAVE_MEMCPY
+#define MD5_memcpy(to,from,count) memcpy(to,from,count)
+#else
 static void MD5_memcpy(unsigned char *, unsigned char *, unsigned int);
+#endif
+
+#if HAVE_MEMSET
+#define MD5_memset(buf,chr,count) memset(buf,chr,count)
+#else
 static void MD5_memset(char *, int, unsigned int);
+#endif
 
 static unsigned char PADDING[64] =
 {
@@ -319,6 +333,7 @@ Decode(u_num32 * output, unsigned char *input, unsigned int len)
            (((u_num32) input[j + 2]) << 16) | (((u_num32) input[j + 3]) << 24);
 }
 
+#if !HAVE_MEMCPY
 /*
  * Note: Replace "for loop" with standard memcpy if possible.
  */
@@ -330,7 +345,9 @@ MD5_memcpy(unsigned char *output, unsigned char *input, unsigned int len)
     for (i = 0; i < len; i++)
        output[i] = input[i];
 }
+#endif
 
+#if !HAVE_MEMSET
 /*
  * Note: Replace "for loop" with standard memset if possible.
  */
@@ -341,3 +358,4 @@ MD5_memset(char *output, int value, unsigned int len)
     for (i = 0; i < len; i++)
        output[i] = (char) value;
 }
+#endif