summaryrefslogtreecommitdiff
path: root/print/mupdf/patches/patch-ae
blob: 48f887a922d68c05b6e855ef62454f8d4dfacc22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$NetBSD: patch-ae,v 1.1 2011/03/08 17:09:25 drochner Exp $

avoid namespace conflict on NetBSD

--- fitz/crypt_sha2.c.orig	2011-03-08 16:13:19.000000000 +0000
+++ fitz/crypt_sha2.c
@@ -15,7 +15,7 @@ static inline int isbigendian(void)
 	return *(char*)&one == 0;
 }
 
-static inline unsigned int bswap32(unsigned int num)
+static inline unsigned int mup_bswap32(unsigned int num)
 {
 	if (!isbigendian())
 	{
@@ -86,7 +86,7 @@ transform(unsigned int state[8], const u
 
 	/* ensure big-endian integers */
 	for (j = 0; j < 16; j++)
-		data[j] = bswap32(data_xe[j]);
+		data[j] = mup_bswap32(data_xe[j]);
 
 	/* Copy state[] to working vars. */
 	memcpy(T, state, sizeof(T));
@@ -172,11 +172,11 @@ void fz_sha256final(fz_sha256 *context, 
 	context->count[1] = (context->count[1] << 3) + (context->count[0] >> 29);
 	context->count[0] = context->count[0] << 3;
 
-	context->buffer.u32[14] = bswap32(context->count[1]);
-	context->buffer.u32[15] = bswap32(context->count[0]);
+	context->buffer.u32[14] = mup_bswap32(context->count[1]);
+	context->buffer.u32[15] = mup_bswap32(context->count[0]);
 	transform(context->state, context->buffer.u32);
 
 	for (j = 0; j < 8; j++)
-		((unsigned int *)digest)[j] = bswap32(context->state[j]);
+		((unsigned int *)digest)[j] = mup_bswap32(context->state[j]);
 	memset(context, 0, sizeof(fz_sha256));
 }