-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSVC compiler support with Win32 pread/pwrite #383
base: main
Are you sure you want to change the base?
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_t
which helps get the MSVC compiler working. But there is nopread
orpwrite
on 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).