gnu: gnome: Depend on xdg-user-dirs.
[jackhill/guix/guix.git] / gnu / packages / patches / mesa-fix-32bit-test-failures.patch
CommitLineData
165d4554
LF
1Fix a test failure when building for 32 bit architectures:
2
3http://lists.gnu.org/archive/html/guix-devel/2017-04/msg00381.html
4
5Patch copied from upstream source repository:
6
7https://cgit.freedesktop.org/mesa/mesa/commit/?id=61bbb25a080e48a8ca897ba7f6e73cc6a8e9b5b8
8
9From 61bbb25a080e48a8ca897ba7f6e73cc6a8e9b5b8 Mon Sep 17 00:00:00 2001
10From: Grazvydas Ignotas <notasas@gmail.com>
11Date: Thu, 9 Mar 2017 02:54:53 +0200
12Subject: [PATCH] util/disk_cache: fix size subtraction on 32bit
13
14Negating size_t on 32bit produces a 32bit result. This was effectively
15adding values close to UINT_MAX to the cache size (the files are usually
16small) instead of intended subtraction.
17Fixes 'make check' disk_cache failures on 32bit.
18
19Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
20Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
21---
22 src/util/disk_cache.c | 6 +++---
23 1 file changed, 3 insertions(+), 3 deletions(-)
24
25diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
26index 5470688df3..facdcecf7c 100644
27--- a/src/util/disk_cache.c
28+++ b/src/util/disk_cache.c
29@@ -603,7 +603,7 @@ evict_random_item(struct disk_cache *cache)
30 free(dir_path);
31
32 if (size) {
33- p_atomic_add(cache->size, - size);
34+ p_atomic_add(cache->size, - (uint64_t)size);
35 return;
36 }
37
38@@ -624,7 +624,7 @@ evict_random_item(struct disk_cache *cache)
39 free(dir_path);
40
41 if (size)
42- p_atomic_add(cache->size, - size);
43+ p_atomic_add(cache->size, - (uint64_t)size);
44 }
45
46 void
47#@@ -646,7 +646,7 @@ disk_cache_remove(struct disk_cache *cache, const cache_key key)
48# free(filename);
49#
50# if (sb.st_size)
51#- p_atomic_add(cache->size, - sb.st_size);
52#+ p_atomic_add(cache->size, - (uint64_t)sb.st_size);
53# }
54#
55# /* From the zlib docs:
56--
572.12.2
58