summaryrefslogtreecommitdiffstats
path: root/src/util/disk_cache.h
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/disk_cache.h
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/disk_cache.h')
-rw-r--r--src/util/disk_cache.h42
1 files changed, 42 insertions, 0 deletions
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