summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-01-18 19:40:31 +0000
committerEmil Velikov <[email protected]>2017-01-18 20:09:01 +0000
commit9f8dc3bf03ec825bae7041858dda6ca2e9a34363 (patch)
treeff9672995474d3c31f027fea8356cb5733e45388 /src/util
parentd1efa09d342bff3e5def2978a0bef748d74f9c82 (diff)
utils: build sha1/disk cache only with Android/Autoconf
Earlier commit imported a SHA1 implementation and relaxed the SHA1 and disk cache handling, broking the Windows builds. Restrict things for now until we get to a proper fix. Fixes: d1efa09d342 "util: import sha1 implementation from OpenBSD" Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/disk_cache.c4
-rw-r--r--src/util/disk_cache.h42
2 files changed, 46 insertions, 0 deletions
diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index 76bdfe8e8b6..6de608c2e4a 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -21,6 +21,8 @@
* IN THE SOFTWARE.
*/
+#ifdef ENABLE_SHADER_CACHE
+
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
@@ -705,3 +707,5 @@ disk_cache_has_key(struct disk_cache *cache, cache_key key)
return memcmp(entry, key, CACHE_KEY_SIZE) == 0;
}
+
+#endif /* ENABLE_SHADER_CACHE */
diff --git a/src/util/disk_cache.h b/src/util/disk_cache.h
index 0b20665e970..7e9cb809b59 100644
--- a/src/util/disk_cache.h
+++ b/src/util/disk_cache.h
@@ -40,6 +40,8 @@ struct disk_cache;
/* Provide inlined stub functions if the shader cache is disabled. */
+#ifdef ENABLE_SHADER_CACHE
+
/**
* Create a new cache object.
*
@@ -129,6 +131,46 @@ disk_cache_put_key(struct disk_cache *cache, cache_key key);
bool
disk_cache_has_key(struct disk_cache *cache, cache_key key);
+#else
+
+static inline struct disk_cache *
+disk_cache_create(void)
+{
+ return NULL;
+}
+
+static inline void
+disk_cache_destroy(struct disk_cache *cache) {
+ return;
+}
+
+static inline void
+disk_cache_put(struct disk_cache *cache, cache_key key,
+ const void *data, size_t size)
+{
+ return;
+}
+
+static inline uint8_t *
+disk_cache_get(struct disk_cache *cache, cache_key key, size_t *size)
+{
+ return NULL;
+}
+
+static inline void
+disk_cache_put_key(struct disk_cache *cache, cache_key key)
+{
+ return;
+}
+
+static inline bool
+disk_cache_has_key(struct disk_cache *cache, cache_key key)
+{
+ return false;
+}
+
+#endif /* ENABLE_SHADER_CACHE */
+
#ifdef __cplusplus
}
#endif