-C Make\ssure\svariable\sdeclarations\soccur\sfirst\sin\scode\sblocks.\s(CVS\s5836)
-D 2008-10-22T16:26:48
+C Removed\ssome\smore\sdead\scode\sand\sfixed\ssome\sunresolved\sexternals\sfor\sWINCE.\s\sTicket\s#3420.\s(CVS\s5837)
+D 2008-10-22T16:55:47
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 4352ab12369706c793f3e8165db35b102c929998
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60
F src/os_os2.c 24221ff5ab20cf3472e3ec7eec595f759de55298
F src/os_unix.c 5e3b3c9a54546249c1317cff5343e965192f7f2b
-F src/os_win.c 13bed718f62d64031b17bb3685adcf994dbf0232
+F src/os_win.c a26292f39a73a446aa56b01871e73545da8ce3e4
F src/pager.c 8377118bd5ae055b66683926b264f6c04442317e
F src/pager.h 4a57b219c0765fe1870238064e3f46e4eb2cf5af
F src/parse.y f4620f42b5e0141e20243b5f963d0fc9c180ab9b
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P a8bb5acf708c8f7e52d3f67b85094116386f10fa
-R 710931e3f1f060e772777d1613d702dc
+P b78f44c91fcf3920e69c11a6f72e8f032905a3c7
+R d00295cf1e272f696a9fb6229b295e8f
U shane
-Z 69aead5e2a809ed3469cd42f7cb51300
+Z b93484f56f8f995214898bd38d76728c
**
** This file contains code that is specific to windows.
**
-** $Id: os_win.c,v 1.135 2008/10/12 02:27:39 shane Exp $
+** $Id: os_win.c,v 1.136 2008/10/22 16:55:47 shane Exp $
*/
#include "sqliteInt.h"
#if SQLITE_OS_WIN /* This file is used for windows only */
** Determine if we are dealing with WindowsCE - which has a much
** reduced API.
*/
-#if defined(SQLITE_OS_WINCE)
+#if SQLITE_OS_WINCE
# define AreFileApisANSI() 1
#endif
ovlp.hEvent = 0;
res = LockFileEx(pFile->h, LOCKFILE_FAIL_IMMEDIATELY,
0, SHARED_SIZE, 0, &ovlp);
+/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
+*/
+#if SQLITE_OS_WINCE==0
}else{
int lk;
sqlite3_randomness(sizeof(lk), &lk);
pFile->sharedLockByte = (lk & 0x7fffffff)%(SHARED_SIZE - 1);
res = LockFile(pFile->h, SHARED_FIRST+pFile->sharedLockByte, 0, 1, 0);
+#endif
}
return res;
}
int res;
if( isNT() ){
res = UnlockFile(pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
+/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
+*/
+#if SQLITE_OS_WINCE==0
}else{
res = UnlockFile(pFile->h, SHARED_FIRST + pFile->sharedLockByte, 0, 1, 0);
+#endif
}
return res;
}
void *zConverted = 0;
if( isNT() ){
zConverted = utf8ToUnicode(zFilename);
+/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
+*/
+#if SQLITE_OS_WINCE==0
}else{
zConverted = utf8ToMbcs(zFilename);
+#endif
}
/* caller will handle out of memory */
return zConverted;
}else{
return SQLITE_NOMEM;
}
+/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
+** Since the ASCII version of these Windows API do not exist for WINCE,
+** it's important to not reference them for WINCE builds.
+*/
+#if SQLITE_OS_WINCE==0
}else{
char *zUtf8;
char zMbcsPath[MAX_PATH];
}else{
return SQLITE_NOMEM;
}
+#endif
}
for(i=strlen(zTempPath); i>0 && zTempPath[i-1]=='\\'; i--){}
zTempPath[i] = 0;
dwFlagsAndAttributes,
NULL
);
+/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
+** Since the ASCII version of these Windows API do not exist for WINCE,
+** it's important to not reference them for WINCE builds.
+*/
+#if SQLITE_OS_WINCE==0
}else{
h = CreateFileA((char*)zConverted,
dwDesiredAccess,
dwFlagsAndAttributes,
NULL
);
+#endif
}
if( h==INVALID_HANDLE_VALUE ){
free(zConverted);
|| ((error = GetLastError()) == ERROR_ACCESS_DENIED))
&& (++cnt < MX_DELETION_ATTEMPTS)
&& (Sleep(100), 1) );
+/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
+** Since the ASCII version of these Windows API do not exist for WINCE,
+** it's important to not reference them for WINCE builds.
+*/
+#if SQLITE_OS_WINCE==0
}else{
do{
DeleteFileA(zConverted);
|| ((error = GetLastError()) == ERROR_ACCESS_DENIED))
&& (++cnt < MX_DELETION_ATTEMPTS)
&& (Sleep(100), 1) );
+#endif
}
free(zConverted);
OSTRACE2("DELETE \"%s\"\n", zFilename);
}
if( isNT() ){
attr = GetFileAttributesW((WCHAR*)zConverted);
+/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
+** Since the ASCII version of these Windows API do not exist for WINCE,
+** it's important to not reference them for WINCE builds.
+*/
+#if SQLITE_OS_WINCE==0
}else{
attr = GetFileAttributesA((char*)zConverted);
+#endif
}
free(zConverted);
switch( flags ){
free(zConverted);
zOut = unicodeToUtf8(zTemp);
free(zTemp);
+/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
+** Since the ASCII version of these Windows API do not exist for WINCE,
+** it's important to not reference them for WINCE builds.
+*/
+#if SQLITE_OS_WINCE==0
}else{
char *zTemp;
nByte = GetFullPathNameA((char*)zConverted, 0, 0, 0) + 3;
free(zConverted);
zOut = mbcsToUtf8(zTemp);
free(zTemp);
+#endif
}
if( zOut ){
sqlite3_snprintf(pVfs->mxPathname, zFull, "%s", zOut);
}
if( isNT() ){
h = LoadLibraryW((WCHAR*)zConverted);
+/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed.
+** Since the ASCII version of these Windows API do not exist for WINCE,
+** it's important to not reference them for WINCE builds.
+*/
+#if SQLITE_OS_WINCE==0
}else{
h = LoadLibraryA((char*)zConverted);
+#endif
}
free(zConverted);
return (void*)h;