mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-02 09:57:40 +00:00
Removed SDL_rwops.h dependency on stdio.h
This commit is contained in:
parent
34d538bd13
commit
fa3814ddf1
3 changed files with 15 additions and 28 deletions
|
@ -112,13 +112,12 @@ typedef struct SDL_RWops
|
|||
} windowsio;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDIO_H
|
||||
struct
|
||||
{
|
||||
SDL_bool autoclose;
|
||||
FILE *fp;
|
||||
void *fp;
|
||||
} stdio;
|
||||
#endif
|
||||
|
||||
struct
|
||||
{
|
||||
Uint8 *base;
|
||||
|
@ -206,25 +205,15 @@ typedef struct SDL_RWops
|
|||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file,
|
||||
const char *mode);
|
||||
|
||||
#ifdef HAVE_STDIO_H
|
||||
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, SDL_bool autoclose);
|
||||
|
||||
#else
|
||||
|
||||
/**
|
||||
* Use this function to create an SDL_RWops structure from a standard I/O file
|
||||
* pointer (stdio.h's `FILE*`).
|
||||
* pointer (stdio.h's `FILE *`).
|
||||
*
|
||||
* This function is not available on Windows, since files opened in an
|
||||
* application on that platform cannot be used by a dynamically linked
|
||||
* library.
|
||||
*
|
||||
* On some platforms, the first parameter is a `void*`, on others, it's a
|
||||
* `FILE*`, depending on what system headers are available to SDL. It is
|
||||
* always intended to be the `FILE*` type from the C runtime's stdio.h.
|
||||
*
|
||||
* \param fp the `FILE*` that feeds the SDL_RWops stream
|
||||
* \param fp the `FILE *` that feeds the SDL_RWops stream
|
||||
* \param autoclose SDL_TRUE to close the `FILE*` when closing the SDL_RWops,
|
||||
* SDL_FALSE to leave the `FILE*` open when the RWops is
|
||||
* closed
|
||||
|
@ -242,9 +231,7 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, SDL_bool autoclose);
|
|||
* \sa SDL_RWtell
|
||||
* \sa SDL_RWwrite
|
||||
*/
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
|
||||
SDL_bool autoclose);
|
||||
#endif
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void *fp, SDL_bool autoclose);
|
||||
|
||||
/**
|
||||
* Use this function to prepare a read-write memory buffer for use with
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue