X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fmd5.c;h=1646676f4f011ce3747715aab2ef146102372176;hb=8579e67153c2b71f4d6e36c274b279dd6429b37d;hp=2fc652cea94a930115186c85779a36b5bbbf6699;hpb=b258c18a6f1cbb23ab21f55325ddaeccf9005cba;p=gnulib.git diff --git a/lib/md5.c b/lib/md5.c index 2fc652cea..1646676f4 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -1,6 +1,6 @@ /* md5.c - Functions to compute MD5 message digest of files or memory blocks according to the definition of MD5 in RFC 1321 from April 1992. - Copyright (C) 1995, 1996, 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 2001, 2003, 2004 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Ulrich Drepper , 1995. */ @@ -26,12 +26,12 @@ #include "md5.h" -#include - -#include +#include #include -#include "unlocked-io.h" +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif #ifdef _LIBC # include @@ -246,13 +246,8 @@ md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx) if (len >= 64) { #if !_STRING_ARCH_unaligned -/* To check alignment gcc has an appropriate operator. Other - compilers don't. */ -# if __GNUC__ >= 2 -# define UNALIGNED_P(p) (((md5_uintptr) p) % __alignof__ (md5_uint32) != 0) -# else -# define UNALIGNED_P(p) (((md5_uintptr) p) % sizeof (md5_uint32) != 0) -# endif +# define alignof(type) offsetof (struct { char c; type x; }, x) +# define UNALIGNED_P(p) (((size_t) p) % alignof (md5_uint32) != 0) if (UNALIGNED_P (buffer)) while (len > 64) {