platform/posix.c
changeset 648 5c993684b8f2
parent 644 1cb5533d369c
child 657 dad3b5c307a9
equal deleted inserted replaced
647:c83b6827fc7d 648:5c993684b8f2
   499     BAIL_IF_MACRO(stat(fname, &statbuf) < 0, strerror(errno), -1);
   499     BAIL_IF_MACRO(stat(fname, &statbuf) < 0, strerror(errno), -1);
   500     return statbuf.st_mtime;
   500     return statbuf.st_mtime;
   501 } /* __PHYSFS_platformGetLastModTime */
   501 } /* __PHYSFS_platformGetLastModTime */
   502 
   502 
   503 
   503 
   504 PHYSFS_memhandle __PHYSFS_platformMalloc(size_t s)
   504 int __PHYSFS_platformAllocatorInit(void)
   505 {
   505 {
   506     assert(sizeof (h) == sizeof (void *));
   506     return(1);  /* always succeeds. */
   507     return((PHYSFS_memhandle) malloc(s));
   507 } /* __PHYSFS_platformAllocatorInit */
       
   508 
       
   509 
       
   510 void __PHYSFS_platformAllocatorDeinit(void)
       
   511 {
       
   512     /* no-op */
       
   513 } /* __PHYSFS_platformAllocatorInit */
       
   514 
       
   515 
       
   516 void *__PHYSFS_platformAllocatorMalloc(size_t s)
       
   517 {
       
   518     return(malloc(s));
   508 } /* __PHYSFS_platformMalloc */
   519 } /* __PHYSFS_platformMalloc */
   509 
   520 
   510 
   521 
   511 PHYSFS_memhandle __PHYSFS_platformRealloc(PHYSFS_memhandle h, size_t s)
   522 void *__PHYSFS_platformAllocatorRealloc(void *ptr, size_t s)
   512 {
   523 {
   513     return((PHYSFS_memhandle) realloc((void *) h, s));
   524     return(realloc(ptr, s));
   514 } /* __PHYSFS_platformRealloc */
   525 } /* __PHYSFS_platformRealloc */
   515 
   526 
   516 
   527 
   517 void __PHYSFS_platformFree(PHYSFS_memhandle h)
   528 void __PHYSFS_platformAllocatorFree(void *ptr)
   518 {
   529 {
   519     free((void *) h);
   530     free(ptr);
   520 } /* __PHYSFS_platformFree */
   531 } /* __PHYSFS_platformAllocatorFree */
   521 
       
   522 
       
   523 void *__PHYSFS_platformLock(PHYSFS_memhandle h)
       
   524 {
       
   525     return((void *) h);
       
   526 } /* __PHYSFS_platformLock */
       
   527 
       
   528 
       
   529 void __PHYSFS_platformUnlock(PHYSFS_memhandle h)
       
   530 {
       
   531     /* no-op. */
       
   532 } /* __PHYSFS_platformUnlock */
       
   533 
   532 
   534 #endif /* !defined WIN32 */
   533 #endif /* !defined WIN32 */
   535 
   534 
   536 /* end of posix.c ... */
   535 /* end of posix.c ... */
   537 
   536