Mercurial > hg > dmlib
diff dmres.c @ 166:112eb95f2fba
Improve build system granularity.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 06 Oct 2012 08:31:37 +0300 |
parents | d5cfd29c87c4 |
children | c6b4fa03744c |
line wrap: on
line diff
--- a/dmres.c Sat Oct 06 08:11:47 2012 +0300 +++ b/dmres.c Sat Oct 06 08:31:37 2012 +0300 @@ -7,9 +7,6 @@ #include "dmres.h" #include <time.h> -#if !defined(DM_USE_PACKFS) && !defined(DM_USE_STDIO) -#error At least one of DM_USE_PACKFS, DM_USE_STDIO must be defined. -#endif #define DMRES_LOCK(x) dmMutexLock(dfResourcesMutex) #define DMRES_UNLOCK(x) dmMutexUnlock(dfResourcesMutex) @@ -395,16 +392,16 @@ dmFree(cbuffer); return res; } -#endif -static void dm_mem_fclose(DMResource * f) +static void dm_pack_fclose(DMResource * f) { f->dataSize = 0; f->dataOffset = 0; dmFree(f->data); f->data = NULL; } +#endif static int dm_mem_ferror(DMResource * f) @@ -496,6 +493,7 @@ } +#ifdef DM_USE_PACKFS DMResourceOps dfPackFileOps = { dm_mem_ferror, @@ -509,9 +507,10 @@ NULL, NULL, - dm_mem_fclose, + dm_pack_fclose, dm_pack_preload }; +#endif DMResourceOps dfMemIOFileOps = @@ -551,7 +550,7 @@ #endif #else - handle->fops = &dfStdioFileOps; + handle->fops = NULL; #endif } }