mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 13:20:43 +00:00
(memmap.c) Some Win32 build fixes
This commit is contained in:
parent
298b29e615
commit
68fa0bcbe7
@ -20,21 +20,35 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <memmap.h>
|
#include <memmap.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define MAP_SHARED 0x01
|
#define MAP_SHARED 0x01
|
||||||
|
|
||||||
|
#ifndef MAP_PRIVATE
|
||||||
#define MAP_PRIVATE 0x02
|
#define MAP_PRIVATE 0x02
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MAP_ANONYMOUS
|
||||||
#define MAP_ANONYMOUS 0x20
|
#define MAP_ANONYMOUS 0x20
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MAP_ANON MAP_ANONYMOUS
|
#define MAP_ANON MAP_ANONYMOUS
|
||||||
#define MAP_FAILED ((void *) -1)
|
#define MAP_FAILED ((void *) -1)
|
||||||
#define PROT_READ 0x1
|
#define PROT_READ 0x1
|
||||||
#define PROT_WRITE 0x2
|
#define PROT_WRITE 0x2
|
||||||
|
|
||||||
/* This flag is only available in WinXP+ */
|
/* This flag is only available in WinXP+ */
|
||||||
#ifdef FILE_MAP_EXECUTE
|
#ifdef FILE_MAP_EXECUTE
|
||||||
|
#ifndef PROT_EXEC
|
||||||
#define PROT_EXEC 0x4
|
#define PROT_EXEC 0x4
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
|
#ifndef PROT_EXEC
|
||||||
#define PROT_EXEC 0x0
|
#define PROT_EXEC 0x0
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FILE_MAP_EXECUTE 0
|
#define FILE_MAP_EXECUTE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -46,7 +60,7 @@
|
|||||||
# define DWORD_LO(x) (x)
|
# define DWORD_LO(x) (x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
|
void *mmap(void *start, size_t length, int prot, int flags, int fd, size_t offset)
|
||||||
{
|
{
|
||||||
uint32_t flProtect, dwDesiredAccess;
|
uint32_t flProtect, dwDesiredAccess;
|
||||||
off_t end;
|
off_t end;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user