static int vout_width, vout_height, vout_offset;
static float user_vout_width = 0.0;
-#ifdef _MSC_VER
-static short sndBuffer[2*44100/50];
-#else
-static short __attribute__((aligned(4))) sndBuffer[2*44100/50];
-#endif
+static short ALIGNED(4) sndBuffer[2*44100/50];
static void snd_write(int len);
int flags = MAP_PRIVATE | MAP_ANONYMOUS;
void *req, *ret;
- req = (void *)addr;
+ req = (void *)(uintptr_t)addr;
ret = mmap(req, size, PROT_READ | PROT_WRITE, flags, -1, 0);
if (ret == MAP_FAILED) {
if (log_cb)
return NULL;
}
- if (addr != 0 && ret != (void *)addr) {
+ if (addr != 0 && ret != (void *)(uintptr_t)addr) {
if (log_cb)
log_cb(RETRO_LOG_WARN, "warning: wanted to map @%08lx, got %p\n",
addr, ret);
{
int ret = -1;
#ifdef _WIN32
- ret = VirtualProtect(ptr, size, PAGE_EXECUTE_READWRITE, 0);
+ DWORD oldProtect = 0;
+ ret = VirtualProtect(ptr, size, PAGE_EXECUTE_READWRITE, &oldProtect);
if (ret == 0 && log_cb)
log_cb(RETRO_LOG_ERROR, "VirtualProtect(%p, %d) failed: %d\n", ptr, (int)size,
GetLastError());