diff --git a/source/lib/sysdep/win/waio.cpp b/source/lib/sysdep/win/waio.cpp index 49ceeceee6..066f44c82e 100755 --- a/source/lib/sysdep/win/waio.cpp +++ b/source/lib/sysdep/win/waio.cpp @@ -475,7 +475,7 @@ debug_out("aio_rw cb=%p\n", cb); size_t ofs = 0; size_t size = cb->aio_nbytes; - void* buf = cb->aio_buf; + void* buf = (void*)cb->aio_buf; // from volatile void* // check if h is a socket #define SOL_SOCKET 0xffff @@ -639,7 +639,7 @@ debug_out("aio_return cb=%p\n", cb); // read wasn't aligned - need to copy to user's buffer const size_t _buf = (char*)cb->aio_buf - (char*)0; if(r->pad || _buf % sector_size) - memcpy(cb->aio_buf, (u8*)r->buf + r->pad, cb->aio_nbytes); + memcpy((void*)cb->aio_buf, (u8*)r->buf + r->pad, cb->aio_nbytes); // TODO: this copies data back into original buffer from align buffer // when writing from unaligned buffer. unnecessarily slow. diff --git a/source/lib/sysdep/win/waio.h b/source/lib/sysdep/win/waio.h index 1a72abdebc..837bf8a646 100755 --- a/source/lib/sysdep/win/waio.h +++ b/source/lib/sysdep/win/waio.h @@ -28,7 +28,7 @@ struct aiocb { int aio_fildes; // File descriptor. off_t aio_offset; // File offset. - void* aio_buf; // Location of buffer. + volatile void* aio_buf; // Location of buffer. size_t aio_nbytes; // Length of transfer. int aio_reqprio; // Request priority offset. struct sigevent aio_sigevent; // Signal number and value.