diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-09-19 21:38:37 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-09-19 21:38:37 +0000 |
commit | 046a18fe7e999f75ad01f2992df59bafd8396d5e (patch) | |
tree | bd656fd448ee693ee231082225a0841c87a3f16d /Build | |
parent | 4c09d08b31c692ac7671c1cba104a58f742173ad (diff) |
Use uint32_t instead of unsigned long to calculate MD5 (from T. Yamamoto)
git-svn-id: svn://tug.org/texlive/trunk@31700 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/dvipdf-x/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/dvipdf-x/dpxcrypt.c | 8 | ||||
-rw-r--r-- | Build/source/texk/dvipdf-x/dpxcrypt.h | 8 |
3 files changed, 14 insertions, 8 deletions
diff --git a/Build/source/texk/dvipdf-x/ChangeLog b/Build/source/texk/dvipdf-x/ChangeLog index 6dfbf0c1223..a80e8c3340d 100644 --- a/Build/source/texk/dvipdf-x/ChangeLog +++ b/Build/source/texk/dvipdf-x/ChangeLog @@ -1,3 +1,9 @@ +2013-09-20 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * dpxcrypt.h, dpxcrypt.c: Use uint32_t instead of unsigned long to + calculate MD5, because it leads to an error if compiled with clang + on 64bit OS X, reported by T. Yamamoto. + 2013-09-18 Peter Breitenlohner <peb@mppmu.mpg.de> Better handling of annotations and bookmarks. diff --git a/Build/source/texk/dvipdf-x/dpxcrypt.c b/Build/source/texk/dvipdf-x/dpxcrypt.c index cc61cd55dc8..e7b96af169f 100644 --- a/Build/source/texk/dvipdf-x/dpxcrypt.c +++ b/Build/source/texk/dvipdf-x/dpxcrypt.c @@ -28,12 +28,6 @@ # include <sys/types.h> #endif #include <string.h> -#ifdef HAVE_INTTYPES_H -# include <inttypes.h> -#endif -#ifdef HAVE_STDINT_H -# include <stdint.h> -#endif #include "dpxcrypt.h" @@ -289,7 +283,7 @@ void MD5_final (unsigned char *outbuf, MD5_CONTEXT *hd) #define X(a) do { *p++ = hd->a; *p++ = hd->a >> 8; \ *p++ = hd->a >> 16; *p++ = hd->a >> 24; } while (0) #else /* little endian */ -#define X(a) do { *(unsigned long *)p = (*hd).a ; p += 4; } while (0) +#define X(a) do { *(uint32_t *)p = (*hd).a ; p += sizeof(uint32_t); } while (0) #endif X(A); X(B); diff --git a/Build/source/texk/dvipdf-x/dpxcrypt.h b/Build/source/texk/dvipdf-x/dpxcrypt.h index d2613043cf8..4470bfd4095 100644 --- a/Build/source/texk/dvipdf-x/dpxcrypt.h +++ b/Build/source/texk/dvipdf-x/dpxcrypt.h @@ -24,10 +24,16 @@ #define _DPXCRYPT_H_ #include <stdio.h> +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif /* libgcrypt md5 */ typedef struct { - unsigned long A,B,C,D; /* chaining variables */ + uint32_t A,B,C,D; /* chaining variables */ unsigned long nblocks; unsigned char buf[64]; int count; |