FreeBSD: Fix compilation with -Werror (#302)

VirtMem_getTmpDir is not used when SHM_ANON is defined which is the case
on FreeBSD. This breaks compilation if -Werror is defined.

Signed-off-by: Emmanuel Vadot <manu@FreeBSD.org>
This commit is contained in:
Emmanuel Vadot
2020-09-27 16:48:06 +02:00
committed by GitHub
parent b49d685cd9
commit cfdf5bd4eb

View File

@@ -351,10 +351,12 @@ static ASMJIT_INLINE int VirtMem_appleSpecificMMapFlags(uint32_t flags) {
}
#endif
#if !defined(SHM_ANON)
static const char* VirtMem_getTmpDir() noexcept {
const char* tmpDir = getenv("TMPDIR");
return tmpDir ? tmpDir : "/tmp";
}
#endif
static Error VirtMem_openAnonymousMemory(int* fd, bool preferTmpOverDevShm) noexcept {
#if defined(SYS_memfd_create)