MSVC compiler support with Win32 pread/pwrite#383
MSVC compiler support with Win32 pread/pwrite#383jonahbeckford wants to merge 2 commits intomirage:mainfrom
Conversation
|
My guess is that, since we are single threaded, we can replace a pread/pwrite with a seek+read/write (assuming the code is not in lwt). For Lwt, I assume that they have a separate implementation of pread/pwrite that works on Windows as well. This seems to be the case after reading https://ocsigen.org/lwt/latest/api/Lwt_unix I guess the problem is then with code like "append" that assumes the seek pointer is always at the end of the file. But this could be enforced just by calling seek before appending data. |
|
If we really wanted to support Windows, perhaps another option is moving IO functions to a library like |
|
Sigh ... I don't know why I didn't see your comments earlier. I had gone ahead and implemented+debugged a Windows port of pread/pwrite implementations. Didn't see any problems with either pread or pwrite during my debugging sessions. TestingI tried the tests (I can't compile I added some debug lines for this one ... line numbers may be a bit off |
fdb312e to
00c00ce
Compare
This PR defines
ssize_twhich helps get the MSVC compiler working. But there is nopreadorpwriteon Windows so more PRs are needed.(I was trying to see if irmin-unix would work on Windows, but there are too many other meaty issues like the lack of pread/pwrite).