]> pd.if.org Git - pdclib.old/blobdiff - platform/win32/functions/stdio/tmpfile.c
win32: update tmpfile return type to be FILE*
[pdclib.old] / platform / win32 / functions / stdio / tmpfile.c
index f3292349f08a9cbb3eb29832c73c1bc892faabf9..d670f23e72f6a8f592f4ebc024667af811a3e374 100644 (file)
 
 static char tmpname_prefix[4] = {0, 0, 0, 0};
 
+extern const _PDCLIB_fileops_t _PDCLIB_fileops;
 extern void _PDCLIB_w32errno( void );
-struct _PDCLIB_file_t * tmpfile( void )
+
+FILE* tmpfile( void )
 {
     if(!tmpname_prefix[0]) {
         char namebuf[MAX_PATH+1];
@@ -67,7 +69,7 @@ struct _PDCLIB_file_t * tmpfile( void )
     /* Set the file to delete on close */
     DeleteFile(name);
 
-    FILE* fs = _PDCLIB_fdopen(fd, _PDCLIB_FWRITE | _PDCLIB_FRW, name);
+    FILE* fs = _PDCLIB_fvopen(((_PDCLIB_fd_t){fd}), &_PDCLIB_fileops, _PDCLIB_FWRITE | _PDCLIB_FRW, name);
     if(!fs) {
         CloseHandle(fd);
     }