mirror of
https://github.com/sqlite/sqlite.git
synced 2026-10-23 21:49:02 +03:00
Portability improvements for Cygwin contributed by Jan Nijtmans.
FossilOrigin-Name: 8dc536e845fa59131052db2909f010b4de7d4bd6bf47abfe6653e83acb4b503c
This commit is contained in:
21
manifest
21
manifest
@@ -1,5 +1,5 @@
|
||||
C Fix\sa\sproblem\scausing\sfts5\sauxiliary\sfunction\sAPI\smethods\sxRowCount()\sand\sxColumnTotalSize()\sto\sreturn\sinaccurate\svalues\safter\srows\shad\sbeen\sdeleted\sfrom\sa\scontentless_delete=1\stable.\sForum\spost\s[forum:/info/5e6f15753a\s|\s5e6f15753a].
|
||||
D 2026-09-16T13:58:43.163
|
||||
C Portability\simprovements\sfor\sCygwin\scontributed\sby\sJan\sNijtmans.
|
||||
D 2026-09-17T13:30:54.731
|
||||
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
@@ -721,7 +721,7 @@ F src/mutex.c 00b8cee206a67fd764d001f3a148494331d8d0b3b9c3974ecd69ff29bb444462
|
||||
F src/mutex.h e2159f6ce3201c90d63045701f0eaa669e9154e8b79d000982d2fa1467432a94
|
||||
F src/mutex_noop.c 9d4309c075ba9cc7249e19412d3d62f7f94839c4
|
||||
F src/mutex_unix.c caec9862aeebad01f6c8997cf709a239abeb0715fcce1895720b87fe7e2ef42f
|
||||
F src/mutex_w32.c d44e94c064f8ab39e0318fb6fa00171cf7e5645bd4241129b07d655a8ddbd44b
|
||||
F src/mutex_w32.c 6c1d1bdae24fa0af58bc6bd53e2e7e3e8ef3568ab20101788bbf96ff9c591162
|
||||
F src/notify.c 57c2d1a2805d6dee32acd5d250d928ab94e02d76369ae057dee7d445fd64e878
|
||||
F src/os.c 9566966dd14376099fe8f715e744ab4fef204f55bd89126c5ddd06eb37df9457
|
||||
F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63
|
||||
@@ -729,7 +729,7 @@ F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e
|
||||
F src/os_kv.c 713336d0c646720a9ccbd5bc6fe217bb4924dd28adea25d83a2af5346cb030e6
|
||||
F src/os_setup.h 8efc64eda6a6c2f221387eefc2e7e45fd5a3d5c8337a7a83519ba4fbd2957ae2
|
||||
F src/os_unix.c 5ccac2954679efc003330a5686cd2048ec9059f90f54f43900e60877e9158aa7
|
||||
F src/os_win.c 19fe1bcea5518605dcccde803d84b56cf24d731b24fb8bc2f94b123a04023cc2
|
||||
F src/os_win.c 364c3095fa6f1bc77b6d55acb7853011a25ff526562a576b5d89b4c14caa20a2
|
||||
F src/os_win.h c06ccc3a090cf54202ea58981c298817f3309d4c9e4d52ad0a02927346493721
|
||||
F src/pager.c fd9ca8fe01b09c490e66a440e2f56648d489ccb9e0e3b5508424079b046fc824
|
||||
F src/pager.h 53cabc1fd881a9c078eab7db6c233bc0ed29d8938fc05585f0e75e80d905d308
|
||||
@@ -754,7 +754,7 @@ F src/status.c 7565d63a79aa2f326339a24a0461a60096d0bd2bce711fefb50b5c89335f3592
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
F src/tclsqlite.c dd385a36a099482f140cb9cee85c759ab47829d1f3dedcf61e3df9c0f4d88562
|
||||
F src/tclsqlite.h 614b3780a62522bc9f8f2b9fb22689e8009958e7aa77e572d0f3149050af348a
|
||||
F src/test1.c 6bb9bee04156c0bead88369d24d1bc0055bb15592402592eb232ef02ffd09198
|
||||
F src/test1.c 933b06ead0fd5cf256384dcc1e19979ef3d679a77c67176f81a7fe40536b46c6
|
||||
F src/test2.c a61ed01d9264a1db74ab42fbc981fc66165f85d5e3947e92be61a73e79ec4f2d
|
||||
F src/test3.c c959fe0c3b04157483f5a6fa1950c1f222e062d920fee0a8e70410c6b6d45522
|
||||
F src/test4.c 0ac87fc13cdb334ab3a71823f99b6c32a6bebe5d603cd6a71d84c823d43a25a0
|
||||
@@ -1651,7 +1651,7 @@ F test/shell7.test 6b006d296b569a7ec78b8168af77578b3bde8f58b79c32d9f46cff1eaf763
|
||||
F test/shell8.test d2fc95f7467c3d93834cac3327bdac03554991afed6d9a07e6a2b204b037f9d7
|
||||
F test/shell9.test c0e8871061a92151450b3332279a893b516fa73a6c46d4f51a0998407cbf8c89
|
||||
F test/shellA.test 05cdaafa1f79913654487ce3aefa038d4106245d58f52e02faf506140a76d480
|
||||
F test/shellB.test 308669158f9b7014bee30dbab58893124bd78d6b1cf7d169c13d704c2edc6fc7
|
||||
F test/shellB.test 95e8f63bcc9f9c9555b873a4846cea131eacfa053a3356b0e4b99de78e40c49e
|
||||
F test/shmlock.test 9f1f729a7fe2c46c88b156af819ac9b72c0714ac6f7246638a73c5752b5fd13c
|
||||
F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
|
||||
F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5
|
||||
@@ -2221,8 +2221,9 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee
|
||||
F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
|
||||
P 4630ee80dcb69588ec1c88d049e313b53258e7e23fc0209ac505c92b3bc85c63
|
||||
R b1ee004a816015877c9c2c8b636a45a2
|
||||
U dan
|
||||
Z 0c7a1e0d5341684747ec84c23ec6dcb7
|
||||
P 39ca0ac36596d37fd62316beb7c6341812624e6d3efea90d68ae0393f742163b fe484c8dbc4829508616a1db1bd38a8e451409bddcc20b593fbf51a6ab1a1b00
|
||||
R 52cefb75678ee4547b7882158be6b7cc
|
||||
T +closed fe484c8dbc4829508616a1db1bd38a8e451409bddcc20b593fbf51a6ab1a1b00 Closed\sby\sintegrate-merge.
|
||||
U stephan
|
||||
Z 048f93b841c256123f90ad1cf548d9b4
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
@@ -1 +1 @@
|
||||
39ca0ac36596d37fd62316beb7c6341812624e6d3efea90d68ae0393f742163b
|
||||
8dc536e845fa59131052db2909f010b4de7d4bd6bf47abfe6653e83acb4b503c
|
||||
|
||||
@@ -37,8 +37,11 @@
|
||||
# define ALIGN128
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4324)
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/*
|
||||
** Each SQLite mutex is an instance of the following structure.
|
||||
**
|
||||
@@ -61,7 +64,9 @@ struct sqlite3_mutex {
|
||||
volatile LONG trace; /* True to trace changes */
|
||||
#endif
|
||||
};
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#ifdef SQLITE_DEBUG
|
||||
/*
|
||||
|
||||
117
src/os_win.c
117
src/os_win.c
@@ -24,7 +24,6 @@
|
||||
** Include the header file for the Windows VFS.
|
||||
*/
|
||||
#include "os_win.h"
|
||||
#define SQLITE_WIN32_HAS_WIDE 1
|
||||
|
||||
/*
|
||||
** This constant should already be defined (in the "WinDef.h" SDK file).
|
||||
@@ -339,24 +338,6 @@ static void winMemShutdown(void *pAppData);
|
||||
const sqlite3_mem_methods *sqlite3MemGetWin32(void);
|
||||
#endif /* SQLITE_WIN32_MALLOC */
|
||||
|
||||
/*
|
||||
** The following variable is (normally) set once and never changes
|
||||
** thereafter. It records whether the operating system is Win9x
|
||||
** or WinNT.
|
||||
**
|
||||
** 0: Operating system unknown.
|
||||
** 1: Operating system is Win9x.
|
||||
** 2: Operating system is WinNT.
|
||||
**
|
||||
** In order to facilitate testing on a WinNT system, the test fixture
|
||||
** can manually set this value to 1 to emulate Win98 behavior.
|
||||
*/
|
||||
#ifdef SQLITE_TEST
|
||||
LONG volatile sqlite3_os_type = 0;
|
||||
#else
|
||||
static LONG volatile sqlite3_os_type = 0;
|
||||
#endif
|
||||
|
||||
#ifndef SYSCALL
|
||||
# define SYSCALL sqlite3_syscall_ptr
|
||||
#endif
|
||||
@@ -881,6 +862,7 @@ int sqlite3_win32_reset_heap(){
|
||||
}
|
||||
#endif /* SQLITE_WIN32_MALLOC */
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
** This function outputs the specified (ANSI) string to the Win32 debugger
|
||||
** (if available). Undocumented. Might go away at any moment.
|
||||
@@ -917,6 +899,7 @@ DWORD sqlite3Win32Wait(HANDLE hObject){
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#ifdef SQLITE_WIN32_MALLOC
|
||||
/*
|
||||
@@ -1177,6 +1160,7 @@ static char *winUnicodeToUtf8(LPCWSTR zWideText){
|
||||
return zText;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
** Convert an ANSI string to Microsoft Unicode, using the ANSI or OEM
|
||||
** code page.
|
||||
@@ -1206,7 +1190,6 @@ static LPWSTR winMbcsToUnicode(const char *zText, int useAnsi){
|
||||
return zMbcsText;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
** Convert a Microsoft Unicode string to a multi-byte character string,
|
||||
** using the ANSI or OEM code page.
|
||||
@@ -1234,7 +1217,6 @@ static char *winUnicodeToMbcs(LPCWSTR zWideText, int useAnsi){
|
||||
}
|
||||
return zText;
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/*
|
||||
** Convert a multi-byte character string to UTF-8.
|
||||
@@ -1254,7 +1236,6 @@ static char *winMbcsToUtf8(const char *zText, int useAnsi){
|
||||
return zTextUtf8;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
** Convert a UTF-8 string to a multi-byte character string.
|
||||
**
|
||||
@@ -1304,7 +1285,6 @@ char *sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
|
||||
#endif
|
||||
return winUnicodeToUtf8(zWideText);
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/*
|
||||
** This is a public wrapper for the winMbcsToUtf8() function.
|
||||
@@ -1322,7 +1302,6 @@ char *sqlite3_win32_mbcs_to_utf8(const char *zText){
|
||||
return winMbcsToUtf8(zText, osAreFileApisANSI());
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
** This is a public wrapper for the winMbcsToUtf8() function.
|
||||
*/
|
||||
@@ -1585,13 +1564,13 @@ static int winRetryIoerr(int *pnRetry, DWORD *pError){
|
||||
return 0;
|
||||
}
|
||||
if( winIoerrCanRetry1(e) ){
|
||||
sqlite3_win32_sleep(winIoerrRetryDelay*(1+*pnRetry));
|
||||
osSleep(winIoerrRetryDelay*(1+*pnRetry));
|
||||
++*pnRetry;
|
||||
return 1;
|
||||
}
|
||||
#if defined(winIoerrCanRetry2)
|
||||
else if( winIoerrCanRetry2(e) ){
|
||||
sqlite3_win32_sleep(winIoerrRetryDelay*(1+*pnRetry));
|
||||
osSleep(winIoerrRetryDelay*(1+*pnRetry));
|
||||
++*pnRetry;
|
||||
return 1;
|
||||
}
|
||||
@@ -1821,7 +1800,7 @@ static int winClose(sqlite3_file *id){
|
||||
do{
|
||||
rc = osCloseHandle(pFile->h);
|
||||
/* SimulateIOError( rc=0; cnt=MX_CLOSE_ATTEMPT; ); */
|
||||
}while( rc==0 && ++cnt < MX_CLOSE_ATTEMPT && (sqlite3_win32_sleep(100), 1) );
|
||||
}while( rc==0 && ++cnt < MX_CLOSE_ATTEMPT && (osSleep(100), 1) );
|
||||
if( rc ){
|
||||
pFile->h = NULL;
|
||||
}
|
||||
@@ -2435,7 +2414,7 @@ static int winLock(sqlite3_file *id, int locktype){
|
||||
}
|
||||
|
||||
cnt--;
|
||||
if( cnt>0 ) sqlite3_win32_sleep(1);
|
||||
if( cnt>0 ) osSleep(1);
|
||||
}
|
||||
gotPendingLock = res;
|
||||
}
|
||||
@@ -2644,7 +2623,7 @@ static void winModeBit(winFile *pFile, unsigned char mask, int *pArg){
|
||||
|
||||
/* Forward references to VFS helper methods used for temporary files */
|
||||
static int winGetTempname(sqlite3_vfs *, char **);
|
||||
static int winIsDir(const void *);
|
||||
static int winIsDir(LPCWSTR);
|
||||
static BOOL winIsLongPathPrefix(const char *);
|
||||
static BOOL winIsDriveLetterAndColon(const char *);
|
||||
|
||||
@@ -2876,11 +2855,10 @@ static SYSTEM_INFO winSysInfo;
|
||||
** happen when the file path >32k, in which case winUtf8ToUnicode()
|
||||
** will fail too.
|
||||
*/
|
||||
static void *winConvertFromUtf8Filename(const char *zFilename){
|
||||
void *zConverted = 0;
|
||||
static LPWSTR winConvertFromUtf8Filename(const char *zFilename){
|
||||
LPWSTR zConverted = 0;
|
||||
#ifdef __CYGWIN__
|
||||
int nChar;
|
||||
LPWSTR zWideFilename;
|
||||
|
||||
if( osCygwin_conv_path && !(winIsDriveLetterAndColon(zFilename)
|
||||
&& winIsDirSep(zFilename[2])) ){
|
||||
@@ -2894,20 +2872,19 @@ static void *winConvertFromUtf8Filename(const char *zFilename){
|
||||
if ( zConverted==0 ){
|
||||
return zConverted;
|
||||
}
|
||||
zWideFilename = zConverted;
|
||||
/* Filenames should be prefixed, except when converted
|
||||
* full path already starts with "\\?\". */
|
||||
if( osCygwin_conv_path(convertflag, zFilename,
|
||||
zWideFilename+4, nByte)==0 ){
|
||||
zConverted+4, nByte)==0 ){
|
||||
if( (convertflag&CCP_RELATIVE) ){
|
||||
memmove(zWideFilename, zWideFilename+4, nByte);
|
||||
}else if( memcmp(zWideFilename+4, L"\\\\", 4) ){
|
||||
memcpy(zWideFilename, L"\\\\?\\", 8);
|
||||
}else if( zWideFilename[6]!='?' ){
|
||||
memmove(zWideFilename+6, zWideFilename+4, nByte);
|
||||
memcpy(zWideFilename, L"\\\\?\\UNC", 14);
|
||||
memmove(zConverted, zConverted+4, nByte);
|
||||
}else if( memcmp(zConverted+4, L"\\\\", 4) ){
|
||||
memcpy(zConverted, L"\\\\?\\", 8);
|
||||
}else if( zConverted[6]!='?' ){
|
||||
memmove(zConverted+6, zConverted+4, nByte);
|
||||
memcpy(zConverted, L"\\\\?\\UNC", 14);
|
||||
}else{
|
||||
memmove(zWideFilename, zWideFilename+4, nByte);
|
||||
memmove(zConverted, zConverted+4, nByte);
|
||||
}
|
||||
return zConverted;
|
||||
}
|
||||
@@ -2918,28 +2895,27 @@ static void *winConvertFromUtf8Filename(const char *zFilename){
|
||||
if( nChar==0 ){
|
||||
return 0;
|
||||
}
|
||||
zWideFilename = sqlite3MallocZero( nChar*sizeof(WCHAR)+12 );
|
||||
if( zWideFilename==0 ){
|
||||
zConverted = sqlite3MallocZero( ((u64)nChar+6)*sizeof(WCHAR) );
|
||||
if( zConverted==0 ){
|
||||
return 0;
|
||||
}
|
||||
nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1,
|
||||
zWideFilename, nChar);
|
||||
zConverted, nChar);
|
||||
if( nChar==0 ){
|
||||
sqlite3_free(zWideFilename);
|
||||
zWideFilename = 0;
|
||||
sqlite3_free(zConverted);
|
||||
zConverted = 0;
|
||||
}else if( nChar>MAX_PATH
|
||||
&& winIsDriveLetterAndColon(zFilename)
|
||||
&& winIsDirSep(zFilename[2]) ){
|
||||
memmove(zWideFilename+4, zWideFilename, nChar*sizeof(WCHAR));
|
||||
zWideFilename[2] = '\\';
|
||||
memcpy(zWideFilename, L"\\\\?\\", 8);
|
||||
memmove(zConverted+4, zConverted, nChar*sizeof(WCHAR));
|
||||
zConverted[2] = '\\';
|
||||
memcpy(zConverted, L"\\\\?\\", 8);
|
||||
}else if( nChar>MAX_PATH
|
||||
&& winIsDirSep(zFilename[0]) && winIsDirSep(zFilename[1])
|
||||
&& zFilename[2] != '?' ){
|
||||
memmove(zWideFilename+6, zWideFilename, nChar*sizeof(WCHAR));
|
||||
memcpy(zWideFilename, L"\\\\?\\UNC", 14);
|
||||
memmove(zConverted+6, zConverted, nChar*sizeof(WCHAR));
|
||||
memcpy(zConverted, L"\\\\?\\UNC", 14);
|
||||
}
|
||||
zConverted = zWideFilename;
|
||||
#else /* if !defined(__CYGWIN__) */
|
||||
zConverted = winUtf8ToUnicode(zFilename);
|
||||
#endif /* __CYGWIN__ */
|
||||
@@ -3161,7 +3137,7 @@ static int winHandleOpen(
|
||||
HANDLE *ph /* OUT: New HANDLE for file */
|
||||
){
|
||||
int rc = SQLITE_OK;
|
||||
void *zConverted = 0;
|
||||
LPWSTR zConverted = 0;
|
||||
int bReadonly = *pbReadonly;
|
||||
HANDLE h = INVALID_HANDLE_VALUE;
|
||||
|
||||
@@ -3189,7 +3165,7 @@ static int winHandleOpen(
|
||||
/* TODO: platforms.
|
||||
** TODO: retry-on-ioerr.
|
||||
*/
|
||||
h = osCreateFileW((LPCWSTR)zConverted, /* lpFileName */
|
||||
h = osCreateFileW(zConverted, /* lpFileName */
|
||||
(GENERIC_READ | (bReadonly ? 0 : GENERIC_WRITE)), /* dwDesiredAccess */
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, /* dwShareMode */
|
||||
NULL, /* lpSecurityAttributes */
|
||||
@@ -4173,7 +4149,7 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){
|
||||
if( !azDirs[3] ) azDirs[3] = osGetenv("TEMP");
|
||||
if( !azDirs[4] ) azDirs[4] = osGetenv("USERPROFILE");
|
||||
for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); zDir=azDirs[i++]){
|
||||
void *zConverted;
|
||||
LPWSTR zConverted;
|
||||
if( zDir==0 ) continue;
|
||||
/* If the path starts with a drive letter followed by the colon
|
||||
** character, assume it is already a native Win32 path; otherwise,
|
||||
@@ -4214,12 +4190,11 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){
|
||||
"winGetTempname2", 0);
|
||||
}
|
||||
zMulti = winUnicodeToUtf8(zWidePath);
|
||||
sqlite3_free(zWidePath);
|
||||
if( zMulti ){
|
||||
sqlite3_snprintf(nMax, zBuf, "%s", zMulti);
|
||||
sqlite3_free(zMulti);
|
||||
sqlite3_free(zWidePath);
|
||||
}else{
|
||||
sqlite3_free(zWidePath);
|
||||
sqlite3_free(zBuf);
|
||||
OSTRACE(("TEMP-FILENAME rc=SQLITE_IOERR_NOMEM\n"));
|
||||
return SQLITE_IOERR_NOMEM_BKPT;
|
||||
@@ -4278,14 +4253,14 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){
|
||||
** it is something other than a directory, or if there is any kind of memory
|
||||
** allocation failure.
|
||||
*/
|
||||
static int winIsDir(const void *zConverted){
|
||||
static int winIsDir(LPCWSTR zConverted){
|
||||
DWORD attr;
|
||||
int rc = 0;
|
||||
DWORD lastErrno;
|
||||
int cnt = 0;
|
||||
WIN32_FILE_ATTRIBUTE_DATA sAttrData;
|
||||
memset(&sAttrData, 0, sizeof(sAttrData));
|
||||
while( !(rc = osGetFileAttributesExW((LPCWSTR)zConverted,
|
||||
while( !(rc = osGetFileAttributesExW(zConverted,
|
||||
GetFileExInfoStandard,
|
||||
&sAttrData)) && winRetryIoerr(&cnt, &lastErrno) ){}
|
||||
if( !rc ){
|
||||
@@ -4327,7 +4302,7 @@ static int winOpen(
|
||||
DWORD dwFlagsAndAttributes = 0;
|
||||
winVfsAppData *pAppData;
|
||||
winFile *pFile = (winFile*)id;
|
||||
void *zConverted; /* Filename in OS encoding */
|
||||
LPWSTR zConverted; /* Filename in OS encoding */
|
||||
const char *zUtf8Name = zName; /* Filename in UTF-8 encoding */
|
||||
int cnt = 0;
|
||||
int isRO = 0; /* file is known to be accessible readonly */
|
||||
@@ -4460,7 +4435,7 @@ static int winOpen(
|
||||
dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
|
||||
}
|
||||
do{
|
||||
h = osCreateFileW((LPCWSTR)zConverted,
|
||||
h = osCreateFileW(zConverted,
|
||||
dwDesiredAccess,
|
||||
dwShareMode, NULL,
|
||||
dwCreationDisposition,
|
||||
@@ -4556,7 +4531,7 @@ static int winDelete(
|
||||
int rc;
|
||||
DWORD attr;
|
||||
DWORD lastErrno = 0;
|
||||
void *zConverted;
|
||||
LPWSTR zConverted;
|
||||
UNUSED_PARAMETER(pVfs);
|
||||
UNUSED_PARAMETER(syncDir);
|
||||
|
||||
@@ -4616,7 +4591,7 @@ static int winAccess(
|
||||
int rc = 0;
|
||||
int cnt = 0;
|
||||
DWORD lastErrno = 0;
|
||||
void *zConverted;
|
||||
LPWSTR zConverted;
|
||||
int noRetry = 0; /* Do not use winRetryIoerr() */
|
||||
WIN32_FILE_ATTRIBUTE_DATA sAttrData;
|
||||
UNUSED_PARAMETER(pVfs);
|
||||
@@ -4643,7 +4618,7 @@ static int winAccess(
|
||||
return SQLITE_IOERR_NOMEM_BKPT;
|
||||
}
|
||||
memset(&sAttrData, 0, sizeof(sAttrData));
|
||||
while( !(rc = osGetFileAttributesExW((LPCWSTR)zConverted,
|
||||
while( !(rc = osGetFileAttributesExW(zConverted,
|
||||
GetFileExInfoStandard,
|
||||
&sAttrData))
|
||||
&& !noRetry
|
||||
@@ -4825,7 +4800,7 @@ static int winFullPathnameNoMutex(
|
||||
char *zFull /* Output buffer */
|
||||
){
|
||||
int nByte;
|
||||
void *zConverted;
|
||||
LPWSTR zConverted;
|
||||
char *zOut;
|
||||
|
||||
/* If this path name begins with "/X:" or "\\?\", where "X" is any
|
||||
@@ -4938,19 +4913,19 @@ static int winFullPathnameNoMutex(
|
||||
}
|
||||
{
|
||||
LPWSTR zTemp;
|
||||
nByte = osGetFullPathNameW((LPCWSTR)zConverted, 0, 0, 0);
|
||||
nByte = osGetFullPathNameW(zConverted, 0, 0, 0);
|
||||
if( nByte==0 ){
|
||||
sqlite3_free(zConverted);
|
||||
return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(),
|
||||
"winFullPathname1", zRelative);
|
||||
}
|
||||
nByte += 3;
|
||||
zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) );
|
||||
zTemp = sqlite3MallocZero( (u64)nByte*sizeof(WCHAR) );
|
||||
if( zTemp==0 ){
|
||||
sqlite3_free(zConverted);
|
||||
return SQLITE_IOERR_NOMEM_BKPT;
|
||||
}
|
||||
nByte = osGetFullPathNameW((LPCWSTR)zConverted, nByte, zTemp, 0);
|
||||
nByte = osGetFullPathNameW(zConverted, nByte, zTemp, 0);
|
||||
if( nByte==0 ){
|
||||
sqlite3_free(zConverted);
|
||||
sqlite3_free(zTemp);
|
||||
@@ -5010,13 +4985,13 @@ static int winFullPathname(
|
||||
*/
|
||||
static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
|
||||
HANDLE h = 0;
|
||||
void *zConverted = winConvertFromUtf8Filename(zFilename);
|
||||
LPWSTR zConverted = winConvertFromUtf8Filename(zFilename);
|
||||
UNUSED_PARAMETER(pVfs);
|
||||
if( zConverted==0 ){
|
||||
OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0));
|
||||
return 0;
|
||||
}
|
||||
h = osLoadLibraryW ? osLoadLibraryW((LPCWSTR)zConverted) : 0;
|
||||
h = osLoadLibraryW ? osLoadLibraryW(zConverted) : 0;
|
||||
OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)h));
|
||||
sqlite3_free(zConverted);
|
||||
return (void*)h;
|
||||
@@ -5124,7 +5099,7 @@ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
|
||||
** Sleep for a little while. Return the amount of time slept.
|
||||
*/
|
||||
static int winSleep(sqlite3_vfs *pVfs, int microsec){
|
||||
sqlite3_win32_sleep((microsec+999)/1000);
|
||||
osSleep((microsec+999)/1000);
|
||||
UNUSED_PARAMETER(pVfs);
|
||||
return ((microsec+999)/1000)*1000;
|
||||
}
|
||||
|
||||
@@ -9483,8 +9483,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
(char*)&pzNeededCollation, TCL_LINK_STRING|TCL_LINK_READ_ONLY);
|
||||
#endif
|
||||
#if SQLITE_OS_WIN
|
||||
Tcl_LinkVar(interp, "sqlite_os_type",
|
||||
(char*)&sqlite3_os_type, TCL_LINK_LONG);
|
||||
Tcl_LinkVar(interp, "sqlite3_win_test_unc_locking",
|
||||
(char*)&sqlite3_win_test_unc_locking, TCL_LINK_INT);
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,7 @@ proc do_clitest {name args} {
|
||||
# file $srcfile. Return true on success.
|
||||
#
|
||||
proc build_loadable {ext srcfile} {
|
||||
if {$::tcl_platform(platform) eq "windows"} {
|
||||
if {$::tcl_platform(os) eq "Windows NT"} {
|
||||
set ext [file root $ext].dll
|
||||
set cmd [list exec gcc -shared -fPIC -I. -I.. -o $ext $srcfile]
|
||||
} elseif {$::tcl_platform(os) eq "Darwin"} {
|
||||
|
||||
Reference in New Issue
Block a user