aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/fileio.c
diff options
context:
space:
mode:
authordrh <>2025-06-09 22:38:34 +0000
committerdrh <>2025-06-09 22:38:34 +0000
commitf091f423ad89143d8b923080d1c6c9c20550a185 (patch)
treeb70de2282d9b0d99fba93881788a00d7d8326d12 /ext/misc/fileio.c
parent4c323ba4beb20f83bd593ec10e73b885b22a931a (diff)
downloadsqlite-f091f423ad89143d8b923080d1c6c9c20550a185.tar.gz
sqlite-f091f423ad89143d8b923080d1c6c9c20550a185.zip
Adjustments to ext/misc/fileio.c in an attempt to get it to build using mingw.
FossilOrigin-Name: 96b14a3f1193de8f30e9fa704f87558dab8027a218868d32e47688cd5df497b7
Diffstat (limited to 'ext/misc/fileio.c')
-rw-r--r--ext/misc/fileio.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/ext/misc/fileio.c b/ext/misc/fileio.c
index 59b789551..01d9c220f 100644
--- a/ext/misc/fileio.c
+++ b/ext/misc/fileio.c
@@ -93,10 +93,11 @@ SQLITE_EXTENSION_INIT1
# include <dirent.h>
# include <utime.h>
# include <sys/time.h>
+# define STRUCT_STAT struct stat
#else
# include "windirent.h"
# include <direct.h>
-# define stat _stat
+# define STRUCT_STAT struct _stat
# define chmod(path,mode) fileio_chmod(path,mode)
# define mkdir(path,mode) fileio_mkdir(path)
#endif
@@ -289,7 +290,7 @@ LPWSTR utf8_to_utf16(const char *z){
*/
static void statTimesToUtc(
const char *zPath,
- struct stat *pStatBuf
+ STRUCT_STAT *pStatBuf
){
HANDLE hFindFile;
WIN32_FIND_DATAW fd;
@@ -317,7 +318,7 @@ static void statTimesToUtc(
*/
static int fileStat(
const char *zPath,
- struct stat *pStatBuf
+ STRUCT_STAT *pStatBuf
){
#if defined(_WIN32)
sqlite3_int64 sz = strlen(zPath);
@@ -341,7 +342,7 @@ static int fileStat(
*/
static int fileLinkStat(
const char *zPath,
- struct stat *pStatBuf
+ STRUCT_STAT *pStatBuf
){
#if defined(_WIN32)
return fileStat(zPath, pStatBuf);
@@ -374,7 +375,7 @@ static int makeDirectory(
int i = 1;
while( rc==SQLITE_OK ){
- struct stat sStat;
+ STRUCT_STAT sStat;
int rc2;
for(; zCopy[i]!='/' && i<nCopy; i++);
@@ -424,7 +425,7 @@ static int writeFile(
** be an error though - if there is already a directory at the same
** path and either the permissions already match or can be changed
** to do so using chmod(), it is not an error. */
- struct stat sStat;
+ STRUCT_STAT sStat;
if( errno!=EEXIST
|| 0!=fileStat(zFile, &sStat)
|| !S_ISDIR(sStat.st_mode)
@@ -627,7 +628,7 @@ struct fsdir_cursor {
const char *zBase;
int nBase;
- struct stat sStat; /* Current lstat() results */
+ STRUCT_STAT sStat; /* Current lstat() results */
char *zPath; /* Path to current entry */
sqlite3_int64 iRowid; /* Current rowid */
};