summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/disk_cache.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/util/disk_cache.h b/src/util/disk_cache.h
index f84840fb5ca..50bd9f41ac4 100644
--- a/src/util/disk_cache.h
+++ b/src/util/disk_cache.h
@@ -24,7 +24,7 @@
#ifndef DISK_CACHE_H
#define DISK_CACHE_H
-#ifdef ENABLE_SHADER_CACHE
+#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
#include <assert.h>
@@ -88,10 +88,10 @@ disk_cache_format_hex_id(char *buf, const uint8_t *hex_id, unsigned size)
return buf;
}
+#ifdef HAVE_DLFCN_H
static inline bool
disk_cache_get_function_timestamp(void *ptr, uint32_t* timestamp)
{
-#ifdef ENABLE_SHADER_CACHE
Dl_info info;
struct stat st;
if (!dladdr(ptr, &info) || !info.dli_fname) {
@@ -102,10 +102,8 @@ disk_cache_get_function_timestamp(void *ptr, uint32_t* timestamp)
}
*timestamp = st.st_mtime;
return true;
-#else
- return false;
-#endif
}
+#endif
/* Provide inlined stub functions if the shader cache is disabled. */