rwops: Make read and write work like POSIX, not stdio.

This simplifies some things, clarifies some things, and also allows
for the possibility of RWops that offer non-blocking i/o (although
none of the current built-in ones do, intentionally, we could add this
later if we choose, or people could provide things like network socket
RWops implementations now, etc.

Fixes #6729.
This commit is contained in:
Ryan C. Gordon
2022-12-14 15:42:54 -05:00
parent e9a9afaded
commit 72c1f73bc5
14 changed files with 196 additions and 197 deletions

View File

@@ -100,7 +100,7 @@ int main(int argc, char **argv)
SDL_WriteLE16(io, bitsize); /* significant bits per sample */
SDL_WriteLE32(io, 0x61746164); /* data */
SDL_WriteLE32(io, cvt.len_cvt); /* size */
SDL_RWwrite(io, cvt.buf, cvt.len_cvt, 1);
SDL_RWwrite(io, cvt.buf, cvt.len_cvt);
if (SDL_RWclose(io) == -1) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "fclose('%s') failed: %s\n", argv[2], SDL_GetError());