Fix Linux build
authorPaul Cercueil <paul@crapouillou.net>
Sat, 8 Feb 2020 16:00:30 +0000 (13:00 -0300)
committerPaul Cercueil <paul@crapouillou.net>
Sat, 8 Feb 2020 16:00:30 +0000 (13:00 -0300)
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Makefile
deps/lightning/lib/jit_memory.c
deps/lightning/lib/lightning.c

index 7afced6..d7f734f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -80,7 +80,7 @@ libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull
 # dynarec
 ifeq "$(DYNAREC)" "lightrec"
 CFLAGS += -Ideps/lightning/include -Ideps/lightrec \
-                 -I deps/mman -DLIGHTREC -DLIGHTREC_STATIC
+                 -DLIGHTREC -DLIGHTREC_STATIC
 OBJS += libpcsxcore/lightrec/plugin.o
 OBJS += deps/lightning/lib/jit_disasm.o \
                deps/lightning/lib/jit_memory.o \
@@ -99,6 +99,7 @@ OBJS += deps/lightning/lib/jit_disasm.o \
                deps/lightrec/regcache.o \
                deps/lightrec/recompiler.o
 ifeq ($(MMAP_WIN32),1)
+CFLAGS += -Ideps/mman
 OBJS += deps/mman/mman.o
 endif
 else ifeq "$(DYNAREC)" "ari64"
index e6b4c73..33b1c35 100644 (file)
 
 #include <lightning.h>
 #include <lightning/jit_private.h>
-#include <mman.h>
+#ifdef _WIN32
+#  include <mman.h>
+#else
+#  include <sys/mman.h>
+#endif
 
 /*
  * Prototypes
index 3f2ab40..507abb6 100644 (file)
 
 #include <lightning.h>
 #include <lightning/jit_private.h>
-#include <mman.h>
+#ifdef _WIN32
+#  include <mman.h>
+#else
+#  include <sys/mman.h>
+#endif
 #if defined(__sgi)
 #  include <fcntl.h>
 #endif