home: hub: 9ficl

Download patch

ref: 44dad66afc8ce48978c267b7068b95c829d16a4e
parent: d9e69e99e9a3688934c3b7e0282650aa8cb666e1
author: jsadler <jsadler@ficl.sf.net>
date: Thu Nov 8 10:35:40 CST 2001

Win32 calls to _stat, _alloca, _fstat replaced with stat, alloca, fstat

--- a/fileaccess.c
+++ b/fileaccess.c
@@ -35,7 +35,7 @@
     char mode[4];
     FILE *f;
 
-    char *filename = (char *)_alloca(length + 1);
+    char *filename = (char *)alloca(length + 1);
     memcpy(filename, address, length);
     filename[length] = 0;
 
@@ -108,7 +108,7 @@
     int length = stackPopINT(pVM->pStack);
     void *address = (void *)stackPopPtr(pVM->pStack);
 
-    char *filename = (char *)_alloca(length + 1);
+    char *filename = (char *)alloca(length + 1);
     memcpy(filename, address, length);
     filename[length] = 0;
 
@@ -124,7 +124,7 @@
 
     length = stackPopINT(pVM->pStack);
     address = (void *)stackPopPtr(pVM->pStack);
-    to = (char *)_alloca(length + 1);
+    to = (char *)alloca(length + 1);
     memcpy(to, address, length);
     to[length] = 0;
 
@@ -131,7 +131,7 @@
     length = stackPopINT(pVM->pStack);
     address = (void *)stackPopPtr(pVM->pStack);
 
-    from = (char *)_alloca(length + 1);
+    from = (char *)alloca(length + 1);
     memcpy(from, address, length);
     from[length] = 0;
 
@@ -145,7 +145,7 @@
     int length = stackPopINT(pVM->pStack);
     void *address = (void *)stackPopPtr(pVM->pStack);
 
-    char *filename = (char *)_alloca(length + 1);
+    char *filename = (char *)alloca(length + 1);
     memcpy(filename, address, length);
     filename[length] = 0;
 
@@ -179,9 +179,9 @@
 
 static long fileSize(FILE *f)
 {
-    struct _stat statbuf;
+    struct stat statbuf;
     statbuf.st_size = -1;
-    if (_fstat(fileno(f), &statbuf) != 0)
+    if (fstat(fileno(f), &statbuf) != 0)
         return -1;
     return statbuf.st_size;
 }