I got creating SDL_RWops from a ZIP file working with physfsrwops.c
I have two little problems:
in physfsrwops.c I removed
Code:
#if SUPPORT_PHYSFS
…
…
#endif
Otherwise I get “undefined reference to …” errors.
How and where can I set/ define SUPPORT_PHYSFS ?
I tried to add
Code:
#define SUPPORT_PHYSFS
in my file which includes physfsrwops.h, but that does not work.
I get some compiler warnings “warning: assignment from incompatible pointer type”
from the create_rwops function in physfsrwops.c
Code:
static SDL_RWops *create_rwops(PHYSFS_file *handle)
{
SDL_RWops *retval = NULL;
if (handle == NULL)
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
else
{
retval = SDL_AllocRW();
if (retval != NULL)
{
## retval->seek = physfsrwops_seek;
## retval->read = physfsrwops_read;
## retval->write = physfsrwops_write;
retval->close = physfsrwops_close;
retval->hidden.unknown.data1 = handle;
} /* if */
} /* else */
return(retval);
} /* create_rwops */
The marked lines (##) are the ones producing the warnings.
It’s a C++11 project. Compiler GCC 4.9.2