diff --git a/Makefile.common b/Makefile.common index a6fcc81d02..5d92b93a52 100644 --- a/Makefile.common +++ b/Makefile.common @@ -132,6 +132,7 @@ OBJ += frontend/frontend.o \ libretro-common/file/dir_list.o \ libretro-common/string/string_list.o \ libretro-common/string/stdstring.o \ + libretro-common/memmap/memmap.o \ dir_list_special.o \ file_ops.o \ libretro-common/file/nbio/nbio_stdio.o \ diff --git a/camera/drivers/video4linux2.c b/camera/drivers/video4linux2.c index 1f103f7a1e..aa8a837d75 100644 --- a/camera/drivers/video4linux2.c +++ b/camera/drivers/video4linux2.c @@ -27,12 +27,12 @@ #include #include #include -#include #include #include #include +#include #include #include diff --git a/libretro-common/include/memmap.h b/libretro-common/include/memmap.h index 492ace6636..2dea42bb66 100644 --- a/libretro-common/include/memmap.h +++ b/libretro-common/include/memmap.h @@ -34,6 +34,15 @@ #include #endif +#if !defined(HAVE_MMAN) +#define PROT_EXEC 0x04 +#define MAP_FAILED 0 +#define PROT_READ 0 +#define PROT_WRITE 0 +#define MAP_PRIVATE 0 +#define MAP_ANONYMOUS 0 +#endif + #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif diff --git a/libretro-common/memmap/memmap.c b/libretro-common/memmap/memmap.c index cfc4974459..10f2bb0098 100644 --- a/libretro-common/memmap/memmap.c +++ b/libretro-common/memmap/memmap.c @@ -125,13 +125,6 @@ int mprotect(void *addr, size_t len, int prot) } #elif !defined(HAVE_MMAN) -#define PROT_EXEC 0x04 -#define MAP_FAILED 0 -#define PROT_READ 0 -#define PROT_WRITE 0 -#define MAP_PRIVATE 0 -#define MAP_ANONYMOUS 0 - void* mmap(void *desired_addr, size_t len, int mmap_prot, int mmap_flags, int fildes, size_t off) { return malloc(len); @@ -162,7 +155,11 @@ int memsync(void *start, void *end) __clear_cache(start, end); return 0; #elif defined(HAVE_MMAN) - return msync(start, len, MS_SYNC | MS_CACHE_ONLY | MS_INVALIDATE_ICACHE); + return msync(start, len, MS_SYNC | MS_INVALIDATE +#ifdef __QNX__ + MS_CACHE_ONLY +#endif + ); #else return 0; #endif