From cfdf5bd4eb68e2d3ba97793a9be6d419d9150edf Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sun, 27 Sep 2020 16:48:06 +0200 Subject: [PATCH] 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 --- src/asmjit/core/virtmem.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/asmjit/core/virtmem.cpp b/src/asmjit/core/virtmem.cpp index 0606748..8f7d9a8 100644 --- a/src/asmjit/core/virtmem.cpp +++ b/src/asmjit/core/virtmem.cpp @@ -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)