Change the OS_XXX pre-processor symbols to SQLITE_OS_XXX. Symbols "OS_UNIX", "OS_WIN", "OS_WINCE", "OS_OS2" and "OS_OTHER" are now "SQLITE_OS_UNIX", "SQLITE_OS_WIN", "SQLITE_OS_WINCE", "SQLITE_OS_OS2" and "SQLITE_OS_OTHER", respectively. (CVS 5311)
FossilOrigin-Name: cdd4cf4ce2ab363ddc3f27c5e44896e17269a161
This commit is contained in:
+2
-2
@@ -14,7 +14,7 @@
|
||||
** other files are for internal use by SQLite and should not be
|
||||
** accessed by users of the library.
|
||||
**
|
||||
** $Id: main.c,v 1.463 2008/06/26 08:29:34 danielk1977 Exp $
|
||||
** $Id: main.c,v 1.464 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@@ -524,7 +524,7 @@ static int sqliteDefaultBusyCallback(
|
||||
void *ptr, /* Database connection */
|
||||
int count /* Number of times table has been busy */
|
||||
){
|
||||
#if OS_WIN || (defined(HAVE_USLEEP) && HAVE_USLEEP)
|
||||
#if SQLITE_OS_WIN || (defined(HAVE_USLEEP) && HAVE_USLEEP)
|
||||
static const u8 delays[] =
|
||||
{ 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 };
|
||||
static const u8 totals[] =
|
||||
|
||||
+4
-4
@@ -19,7 +19,7 @@
|
||||
** Source files should #include the sqliteInt.h file and let that file
|
||||
** include this one indirectly.
|
||||
**
|
||||
** $Id: mutex.h,v 1.7 2008/06/19 01:50:09 drh Exp $
|
||||
** $Id: mutex.h,v 1.8 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
|
||||
|
||||
@@ -53,15 +53,15 @@
|
||||
# undef SQLITE_MUTEX_NOOP
|
||||
# define SQLITE_MUTEX_NOOP_DEBUG
|
||||
#endif
|
||||
#if defined(SQLITE_MUTEX_NOOP) && SQLITE_THREADSAFE && OS_UNIX
|
||||
#if defined(SQLITE_MUTEX_NOOP) && SQLITE_THREADSAFE && SQLITE_OS_UNIX
|
||||
# undef SQLITE_MUTEX_NOOP
|
||||
# define SQLITE_MUTEX_PTHREADS
|
||||
#endif
|
||||
#if defined(SQLITE_MUTEX_NOOP) && SQLITE_THREADSAFE && OS_WIN
|
||||
#if defined(SQLITE_MUTEX_NOOP) && SQLITE_THREADSAFE && SQLITE_OS_WIN
|
||||
# undef SQLITE_MUTEX_NOOP
|
||||
# define SQLITE_MUTEX_W32
|
||||
#endif
|
||||
#if defined(SQLITE_MUTEX_NOOP) && SQLITE_THREADSAFE && OS_OS2
|
||||
#if defined(SQLITE_MUTEX_NOOP) && SQLITE_THREADSAFE && SQLITE_OS_OS2
|
||||
# undef SQLITE_MUTEX_NOOP
|
||||
# define SQLITE_MUTEX_OS2
|
||||
#endif
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@
|
||||
*************************************************************************
|
||||
** This file contains the C functions that implement mutexes for win32
|
||||
**
|
||||
** $Id: mutex_w32.c,v 1.10 2008/06/19 16:07:07 drh Exp $
|
||||
** $Id: mutex_w32.c,v 1.11 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -42,7 +42,7 @@ struct sqlite3_mutex {
|
||||
** WinNT/2K/XP so that we will know whether or not we can safely call
|
||||
** the LockFileEx() API.
|
||||
*/
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
# define mutexIsNT() (1)
|
||||
#else
|
||||
static int mutexIsNT(void){
|
||||
@@ -55,7 +55,7 @@ struct sqlite3_mutex {
|
||||
}
|
||||
return osType==2;
|
||||
}
|
||||
#endif /* OS_WINCE */
|
||||
#endif /* SQLITE_OS_WINCE */
|
||||
|
||||
|
||||
#ifdef SQLITE_DEBUG
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
** This file contains OS interface code that is common to all
|
||||
** architectures.
|
||||
**
|
||||
** $Id: os.c,v 1.117 2008/06/26 08:29:34 danielk1977 Exp $
|
||||
** $Id: os.c,v 1.118 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
#define _SQLITE_OS_C_ 1
|
||||
#include "sqliteInt.h"
|
||||
@@ -36,7 +36,7 @@
|
||||
** sqlite3OsLock()
|
||||
**
|
||||
*/
|
||||
#if defined(SQLITE_TEST) && (OS_WIN==0)
|
||||
#if defined(SQLITE_TEST) && (SQLITE_OS_WIN==0)
|
||||
#define DO_OS_MALLOC_TEST if (1) { \
|
||||
void *pTstAlloc = sqlite3Malloc(10); \
|
||||
if (!pTstAlloc) return SQLITE_IOERR_NOMEM; \
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
** This header file is #include-ed by sqliteInt.h and thus ends up
|
||||
** being included by every source file.
|
||||
**
|
||||
** $Id: os.h,v 1.104 2008/06/25 17:19:01 danielk1977 Exp $
|
||||
** $Id: os.h,v 1.105 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
#ifndef _SQLITE_OS_H_
|
||||
#define _SQLITE_OS_H_
|
||||
@@ -25,44 +25,45 @@
|
||||
/*
|
||||
** Figure out if we are dealing with Unix, Windows, or some other
|
||||
** operating system. After the following block of preprocess macros,
|
||||
** all of OS_UNIX, OS_WIN, OS_OS2, and OS_OTHER will defined to either
|
||||
** 1 or 0. One of the four will be 1. The other three will be 0.
|
||||
** all of SQLITE_OS_UNIX, SQLITE_OS_WIN, SQLITE_OS_OS2, and SQLITE_OS_OTHER
|
||||
** will defined to either 1 or 0. One of the four will be 1. The other
|
||||
** three will be 0.
|
||||
*/
|
||||
#if defined(OS_OTHER)
|
||||
# if OS_OTHER==1
|
||||
# undef OS_UNIX
|
||||
# define OS_UNIX 0
|
||||
# undef OS_WIN
|
||||
# define OS_WIN 0
|
||||
# undef OS_OS2
|
||||
# define OS_OS2 0
|
||||
#if defined(SQLITE_OS_OTHER)
|
||||
# if SQLITE_OS_OTHER==1
|
||||
# undef SQLITE_OS_UNIX
|
||||
# define SQLITE_OS_UNIX 0
|
||||
# undef SQLITE_OS_WIN
|
||||
# define SQLITE_OS_WIN 0
|
||||
# undef SQLITE_OS_OS2
|
||||
# define SQLITE_OS_OS2 0
|
||||
# else
|
||||
# undef OS_OTHER
|
||||
# undef SQLITE_OS_OTHER
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(OS_UNIX) && !defined(OS_OTHER)
|
||||
# define OS_OTHER 0
|
||||
# ifndef OS_WIN
|
||||
#if !defined(SQLITE_OS_UNIX) && !defined(SQLITE_OS_OTHER)
|
||||
# define SQLITE_OS_OTHER 0
|
||||
# ifndef SQLITE_OS_WIN
|
||||
# if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__)
|
||||
# define OS_WIN 1
|
||||
# define OS_UNIX 0
|
||||
# define OS_OS2 0
|
||||
# define SQLITE_OS_WIN 1
|
||||
# define SQLITE_OS_UNIX 0
|
||||
# define SQLITE_OS_OS2 0
|
||||
# elif defined(__EMX__) || defined(_OS2) || defined(OS2) || defined(_OS2_) || defined(__OS2__)
|
||||
# define OS_WIN 0
|
||||
# define OS_UNIX 0
|
||||
# define OS_OS2 1
|
||||
# define SQLITE_OS_WIN 0
|
||||
# define SQLITE_OS_UNIX 0
|
||||
# define SQLITE_OS_OS2 1
|
||||
# else
|
||||
# define OS_WIN 0
|
||||
# define OS_UNIX 1
|
||||
# define OS_OS2 0
|
||||
# define SQLITE_OS_WIN 0
|
||||
# define SQLITE_OS_UNIX 1
|
||||
# define SQLITE_OS_OS2 0
|
||||
# endif
|
||||
# else
|
||||
# define OS_UNIX 0
|
||||
# define OS_OS2 0
|
||||
# define SQLITE_OS_UNIX 0
|
||||
# define SQLITE_OS_OS2 0
|
||||
# endif
|
||||
#else
|
||||
# ifndef OS_WIN
|
||||
# define OS_WIN 0
|
||||
# ifndef SQLITE_OS_WIN
|
||||
# define SQLITE_OS_WIN 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -71,19 +72,19 @@
|
||||
** reduced API.
|
||||
*/
|
||||
#if defined(_WIN32_WCE)
|
||||
# define OS_WINCE 1
|
||||
# define SQLITE_OS_WINCE 1
|
||||
#else
|
||||
# define OS_WINCE 0
|
||||
# define SQLITE_OS_WINCE 0
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** Define the maximum size of a temporary filename
|
||||
*/
|
||||
#if OS_WIN
|
||||
#if SQLITE_OS_WIN
|
||||
# include <windows.h>
|
||||
# define SQLITE_TEMPNAME_SIZE (MAX_PATH+50)
|
||||
#elif OS_OS2
|
||||
#elif SQLITE_OS_OS2
|
||||
# if (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 3) && defined(OS2_HIGH_MEMORY)
|
||||
# include <os2safe.h> /* has to be included before os2.h for linking to work */
|
||||
# endif
|
||||
|
||||
+3
-3
@@ -12,12 +12,12 @@
|
||||
**
|
||||
** This file contains code that is specific to OS/2.
|
||||
**
|
||||
** $Id: os_os2.c,v 1.46 2008/06/25 17:19:01 danielk1977 Exp $
|
||||
** $Id: os_os2.c,v 1.47 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
|
||||
#include "sqliteInt.h"
|
||||
|
||||
#if OS_OS2
|
||||
#if SQLITE_OS_OS2
|
||||
|
||||
/*
|
||||
** A Note About Memory Allocation:
|
||||
@@ -1077,4 +1077,4 @@ int sqlite3_os_end(void){
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
#endif /* OS_OS2 */
|
||||
#endif /* SQLITE_OS_OS2 */
|
||||
|
||||
+3
-3
@@ -12,10 +12,10 @@
|
||||
**
|
||||
** This file contains code that is specific to Unix systems.
|
||||
**
|
||||
** $Id: os_unix.c,v 1.189 2008/06/25 17:19:01 danielk1977 Exp $
|
||||
** $Id: os_unix.c,v 1.190 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#if OS_UNIX /* This file is used on unix only */
|
||||
#if SQLITE_OS_UNIX /* This file is used on unix only */
|
||||
|
||||
/* #define SQLITE_ENABLE_LOCKING_STYLE 0 */
|
||||
|
||||
@@ -2811,4 +2811,4 @@ int sqlite3_os_end(void){
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
#endif /* OS_UNIX */
|
||||
#endif /* SQLITE_OS_UNIX */
|
||||
|
||||
+22
-22
@@ -12,10 +12,10 @@
|
||||
**
|
||||
** This file contains code that is specific to windows.
|
||||
**
|
||||
** $Id: os_win.c,v 1.128 2008/06/25 17:19:01 danielk1977 Exp $
|
||||
** $Id: os_win.c,v 1.129 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#if OS_WIN /* This file is used for windows only */
|
||||
#if SQLITE_OS_WIN /* This file is used for windows only */
|
||||
|
||||
|
||||
/*
|
||||
@@ -66,7 +66,7 @@
|
||||
** Determine if we are dealing with WindowsCE - which has a much
|
||||
** reduced API.
|
||||
*/
|
||||
#if defined(OS_WINCE)
|
||||
#if defined(SQLITE_OS_WINCE)
|
||||
# define AreFileApisANSI() 1
|
||||
#endif
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
** WinCE lacks native support for file locking so we have to fake it
|
||||
** with some code of our own.
|
||||
*/
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
typedef struct winceLock {
|
||||
int nReaders; /* Number of reader locks obtained */
|
||||
BOOL bPending; /* Indicates a pending lock has been obtained */
|
||||
@@ -93,7 +93,7 @@ struct winFile {
|
||||
HANDLE h; /* Handle for accessing the file */
|
||||
unsigned char locktype; /* Type of lock currently held on this file */
|
||||
short sharedLockByte; /* Randomly chosen byte used as a shared lock */
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
WCHAR *zDeleteOnClose; /* Name of file to delete when closing */
|
||||
HANDLE hMutex; /* Mutex used to control access to shared lock */
|
||||
HANDLE hShared; /* Shared memory segment used for locking */
|
||||
@@ -132,7 +132,7 @@ static int sqlite3_os_type = 0;
|
||||
** WinNT/2K/XP so that we will know whether or not we can safely call
|
||||
** the LockFileEx() API.
|
||||
*/
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
# define isNT() (1)
|
||||
#else
|
||||
static int isNT(void){
|
||||
@@ -144,7 +144,7 @@ static int sqlite3_os_type = 0;
|
||||
}
|
||||
return sqlite3_os_type==2;
|
||||
}
|
||||
#endif /* OS_WINCE */
|
||||
#endif /* SQLITE_OS_WINCE */
|
||||
|
||||
/*
|
||||
** Convert a UTF-8 string to microsoft unicode (UTF-16?).
|
||||
@@ -275,7 +275,7 @@ static char *utf8ToMbcs(const char *zFilename){
|
||||
return zFilenameMbcs;
|
||||
}
|
||||
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
/*************************************************************************
|
||||
** This section contains code for WinCE only.
|
||||
*/
|
||||
@@ -579,7 +579,7 @@ static BOOL winceLockFileEx(
|
||||
/*
|
||||
** End of the special code for wince
|
||||
*****************************************************************************/
|
||||
#endif /* OS_WINCE */
|
||||
#endif /* SQLITE_OS_WINCE */
|
||||
|
||||
/*****************************************************************************
|
||||
** The next group of routines implement the I/O methods specified
|
||||
@@ -604,7 +604,7 @@ static int winClose(sqlite3_file *id){
|
||||
do{
|
||||
rc = CloseHandle(pFile->h);
|
||||
}while( rc==0 && cnt++ < MX_CLOSE_ATTEMPT && (Sleep(100), 1) );
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
#define WINCE_DELETION_ATTEMPTS 3
|
||||
winceDestroyLock(pFile);
|
||||
if( pFile->zDeleteOnClose ){
|
||||
@@ -1179,7 +1179,7 @@ static int winOpen(
|
||||
dwShareMode = 0;
|
||||
}
|
||||
if( flags & SQLITE_OPEN_DELETEONCLOSE ){
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
dwFlagsAndAttributes = FILE_ATTRIBUTE_HIDDEN;
|
||||
#else
|
||||
dwFlagsAndAttributes = FILE_ATTRIBUTE_TEMPORARY
|
||||
@@ -1204,7 +1204,7 @@ static int winOpen(
|
||||
NULL
|
||||
);
|
||||
}else{
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
return SQLITE_NOMEM;
|
||||
#else
|
||||
h = CreateFileA((char*)zConverted,
|
||||
@@ -1236,7 +1236,7 @@ static int winOpen(
|
||||
memset(pFile, 0, sizeof(*pFile));
|
||||
pFile->pMethod = &winIoMethod;
|
||||
pFile->h = h;
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
if( (flags & (SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_DB)) ==
|
||||
(SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_DB)
|
||||
&& !winceCreateLock(zName, pFile)
|
||||
@@ -1287,7 +1287,7 @@ static int winDelete(
|
||||
}while( (rc = GetFileAttributesW(zConverted))!=0xffffffff
|
||||
&& cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
|
||||
}else{
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
return SQLITE_NOMEM;
|
||||
#else
|
||||
do{
|
||||
@@ -1319,7 +1319,7 @@ static int winAccess(
|
||||
if( isNT() ){
|
||||
attr = GetFileAttributesW((WCHAR*)zConverted);
|
||||
}else{
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
return SQLITE_NOMEM;
|
||||
#else
|
||||
attr = GetFileAttributesA((char*)zConverted);
|
||||
@@ -1359,13 +1359,13 @@ static int winFullPathname(
|
||||
return SQLITE_OK;
|
||||
#endif
|
||||
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
/* WinCE has no concept of a relative pathname, or so I am told. */
|
||||
sqlite3_snprintf(pVfs->mxPathname, zFull, "%s", zRelative);
|
||||
return SQLITE_OK;
|
||||
#endif
|
||||
|
||||
#if !OS_WINCE && !defined(__CYGWIN__)
|
||||
#if !SQLITE_OS_WINCE && !defined(__CYGWIN__)
|
||||
int nByte;
|
||||
void *zConverted;
|
||||
char *zOut;
|
||||
@@ -1423,7 +1423,7 @@ static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
|
||||
if( isNT() ){
|
||||
h = LoadLibraryW((WCHAR*)zConverted);
|
||||
}else{
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
return 0;
|
||||
#else
|
||||
h = LoadLibraryA((char*)zConverted);
|
||||
@@ -1433,7 +1433,7 @@ static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
|
||||
return (void*)h;
|
||||
}
|
||||
static void winDlError(sqlite3_vfs *pVfs, int nBuf, char *zBufOut){
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
int error = GetLastError();
|
||||
if( error>0x7FFFFFF ){
|
||||
sqlite3_snprintf(nBuf, zBufOut, "OsError 0x%x", error);
|
||||
@@ -1453,7 +1453,7 @@ static void winDlError(sqlite3_vfs *pVfs, int nBuf, char *zBufOut){
|
||||
#endif
|
||||
}
|
||||
void *winDlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol){
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
/* The GetProcAddressA() routine is only available on wince. */
|
||||
return GetProcAddressA((HANDLE)pHandle, zSymbol);
|
||||
#else
|
||||
@@ -1531,7 +1531,7 @@ int winCurrentTime(sqlite3_vfs *pVfs, double *prNow){
|
||||
100-nanosecond intervals since January 1, 1601 (= JD 2305813.5).
|
||||
*/
|
||||
double now;
|
||||
#if OS_WINCE
|
||||
#if SQLITE_OS_WINCE
|
||||
SYSTEMTIME time;
|
||||
GetSystemTime(&time);
|
||||
SystemTimeToFileTime(&time,&ft);
|
||||
@@ -1584,4 +1584,4 @@ int sqlite3_os_end(void){
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
#endif /* OS_WIN */
|
||||
#endif /* SQLITE_OS_WIN */
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@
|
||||
** This file contains code to implement the "sqlite" command line
|
||||
** utility for accessing SQLite databases.
|
||||
**
|
||||
** $Id: shell.c,v 1.181 2008/06/23 21:26:05 mihailim Exp $
|
||||
** $Id: shell.c,v 1.182 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -1946,7 +1946,7 @@ int main(int argc, char **argv){
|
||||
}
|
||||
}
|
||||
if( i<argc ){
|
||||
#if defined(OS_OS2) && OS_OS2
|
||||
#if defined(SQLITE_OS_OS2) && SQLITE_OS_OS2
|
||||
data.zDbFilename = (const char *)convertCpPathToUtf8( argv[i++] );
|
||||
#else
|
||||
data.zDbFilename = argv[i++];
|
||||
|
||||
+5
-5
@@ -13,7 +13,7 @@
|
||||
** is not included in the SQLite library. It is used for automated
|
||||
** testing of the SQLite library.
|
||||
**
|
||||
** $Id: test1.c,v 1.306 2008/06/19 02:52:25 drh Exp $
|
||||
** $Id: test1.c,v 1.307 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "tcl.h"
|
||||
@@ -4736,10 +4736,10 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
extern int sqlite3_pager_writedb_count;
|
||||
extern int sqlite3_pager_writej_count;
|
||||
extern int sqlite3_pager_pgfree_count;
|
||||
#if OS_UNIX && defined(SQLITE_TEST) && SQLITE_THREADSAFE
|
||||
#if SQLITE_OS_UNIX && defined(SQLITE_TEST) && SQLITE_THREADSAFE
|
||||
extern int threadsOverrideEachOthersLocks;
|
||||
#endif
|
||||
#if OS_WIN
|
||||
#if SQLITE_OS_WIN
|
||||
extern int sqlite3_os_type;
|
||||
#endif
|
||||
#ifdef SQLITE_DEBUG
|
||||
@@ -4788,7 +4788,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
Tcl_LinkVar(interp, "unaligned_string_counter",
|
||||
(char*)&unaligned_string_counter, TCL_LINK_INT);
|
||||
#endif
|
||||
#if OS_UNIX && defined(SQLITE_TEST) && SQLITE_THREADSAFE
|
||||
#if SQLITE_OS_UNIX && defined(SQLITE_TEST) && SQLITE_THREADSAFE
|
||||
Tcl_LinkVar(interp, "threadsOverrideEachOthersLocks",
|
||||
(char*)&threadsOverrideEachOthersLocks, TCL_LINK_INT);
|
||||
#endif
|
||||
@@ -4796,7 +4796,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
Tcl_LinkVar(interp, "sqlite_last_needed_collation",
|
||||
(char*)&pzNeededCollation, TCL_LINK_STRING|TCL_LINK_READ_ONLY);
|
||||
#endif
|
||||
#if OS_WIN
|
||||
#if SQLITE_OS_WIN
|
||||
Tcl_LinkVar(interp, "sqlite_os_type",
|
||||
(char*)&sqlite3_os_type, TCL_LINK_INT);
|
||||
#endif
|
||||
|
||||
+3
-3
@@ -11,11 +11,11 @@
|
||||
*************************************************************************
|
||||
** Code for testing the the SQLite library in a multithreaded environment.
|
||||
**
|
||||
** $Id: test4.c,v 1.21 2007/08/22 11:41:18 drh Exp $
|
||||
** $Id: test4.c,v 1.22 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "tcl.h"
|
||||
#if defined(OS_UNIX) && OS_UNIX==1 && SQLITE_THREADSAFE
|
||||
#if defined(SQLITE_OS_UNIX) && OS_UNIX==1 && SQLITE_THREADSAFE
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
@@ -713,4 +713,4 @@ int Sqlitetest4_Init(Tcl_Interp *interp){
|
||||
}
|
||||
#else
|
||||
int Sqlitetest4_Init(Tcl_Interp *interp){ return TCL_OK; }
|
||||
#endif /* OS_UNIX */
|
||||
#endif /* SQLITE_OS_UNIX */
|
||||
|
||||
+3
-3
@@ -12,7 +12,7 @@
|
||||
** Code for testing the client/server version of the SQLite library.
|
||||
** Derived from test4.c.
|
||||
**
|
||||
** $Id: test7.c,v 1.10 2007/10/05 15:04:13 danielk1977 Exp $
|
||||
** $Id: test7.c,v 1.11 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "tcl.h"
|
||||
@@ -22,7 +22,7 @@
|
||||
** the SQLITE_SERVER option.
|
||||
*/
|
||||
#if defined(SQLITE_SERVER) && !defined(SQLITE_OMIT_SHARED_CACHE) && \
|
||||
defined(OS_UNIX) && OS_UNIX && SQLITE_THREADSAFE
|
||||
defined(SQLITE_OS_UNIX) && OS_UNIX && SQLITE_THREADSAFE
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -720,4 +720,4 @@ int Sqlitetest7_Init(Tcl_Interp *interp){
|
||||
}
|
||||
#else
|
||||
int Sqlitetest7_Init(Tcl_Interp *interp){ return TCL_OK; }
|
||||
#endif /* OS_UNIX */
|
||||
#endif /* SQLITE_OS_UNIX */
|
||||
|
||||
+5
-5
@@ -10,7 +10,7 @@
|
||||
**
|
||||
*************************************************************************
|
||||
**
|
||||
** $Id: test_async.c,v 1.44 2008/06/06 11:11:26 danielk1977 Exp $
|
||||
** $Id: test_async.c,v 1.45 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
**
|
||||
** This file contains an example implementation of an asynchronous IO
|
||||
** backend for SQLite.
|
||||
@@ -117,7 +117,7 @@
|
||||
** This test uses pthreads and hence only works on unix and with
|
||||
** a threadsafe build of SQLite.
|
||||
*/
|
||||
#if OS_UNIX && SQLITE_THREADSAFE
|
||||
#if SQLITE_OS_UNIX && SQLITE_THREADSAFE
|
||||
|
||||
/*
|
||||
** This demo uses pthreads. If you do not have a pthreads implementation
|
||||
@@ -1696,7 +1696,7 @@ static int testAsyncWait(
|
||||
}
|
||||
|
||||
|
||||
#endif /* OS_UNIX and SQLITE_THREADSAFE */
|
||||
#endif /* SQLITE_OS_UNIX and SQLITE_THREADSAFE */
|
||||
|
||||
/*
|
||||
** This routine registers the custom TCL commands defined in this
|
||||
@@ -1704,7 +1704,7 @@ static int testAsyncWait(
|
||||
** of this module.
|
||||
*/
|
||||
int Sqlitetestasync_Init(Tcl_Interp *interp){
|
||||
#if OS_UNIX && SQLITE_THREADSAFE
|
||||
#if SQLITE_OS_UNIX && SQLITE_THREADSAFE
|
||||
Tcl_CreateObjCommand(interp,"sqlite3async_enable",testAsyncEnable,0,0);
|
||||
Tcl_CreateObjCommand(interp,"sqlite3async_halt",testAsyncHalt,0,0);
|
||||
Tcl_CreateObjCommand(interp,"sqlite3async_delay",testAsyncDelay,0,0);
|
||||
@@ -1712,6 +1712,6 @@ int Sqlitetestasync_Init(Tcl_Interp *interp){
|
||||
Tcl_CreateObjCommand(interp,"sqlite3async_wait",testAsyncWait,0,0);
|
||||
Tcl_LinkVar(interp, "sqlite3async_trace",
|
||||
(char*)&sqlite3async_trace, TCL_LINK_INT);
|
||||
#endif /* OS_UNIX and SQLITE_THREADSAFE */
|
||||
#endif /* SQLITE_OS_UNIX and SQLITE_THREADSAFE */
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
** The focus of this file is providing the TCL testing layer
|
||||
** access to compile-time constants.
|
||||
**
|
||||
** $Id: test_config.c,v 1.28 2008/06/25 14:57:54 danielk1977 Exp $
|
||||
** $Id: test_config.c,v 1.29 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
*/
|
||||
|
||||
#include "sqliteLimit.h"
|
||||
@@ -183,7 +183,7 @@ static void set_options(Tcl_Interp *interp){
|
||||
Tcl_SetVar2(interp, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#if OS_UNIX
|
||||
#if SQLITE_OS_UNIX
|
||||
Tcl_SetVar2(interp, "sqlite_options", "crashtest", "1", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
Tcl_SetVar2(interp, "sqlite_options", "crashtest", "0", TCL_GLOBAL_ONLY);
|
||||
|
||||
+3
-3
@@ -10,7 +10,7 @@
|
||||
**
|
||||
******************************************************************************
|
||||
**
|
||||
** $Id: test_server.c,v 1.7 2008/05/16 04:51:55 danielk1977 Exp $
|
||||
** $Id: test_server.c,v 1.8 2008/06/26 10:41:19 danielk1977 Exp $
|
||||
**
|
||||
** This file contains demonstration code. Nothing in this file gets compiled
|
||||
** or linked into the SQLite library unless you use a non-standard option:
|
||||
@@ -208,7 +208,7 @@
|
||||
** and only if the SQLITE_SERVER macro is defined.
|
||||
*/
|
||||
#if defined(SQLITE_SERVER) && !defined(SQLITE_OMIT_SHARED_CACHE)
|
||||
#if defined(OS_UNIX) && OS_UNIX && SQLITE_THREADSAFE
|
||||
#if defined(SQLITE_OS_UNIX) && OS_UNIX && SQLITE_THREADSAFE
|
||||
|
||||
/*
|
||||
** We require only pthreads and the public interface of SQLite.
|
||||
@@ -489,5 +489,5 @@ void sqlite3_server_stop(void){
|
||||
pthread_mutex_unlock(&g.serverMutex);
|
||||
}
|
||||
|
||||
#endif /* defined(OS_UNIX) && OS_UNIX && SQLITE_THREADSAFE */
|
||||
#endif /* defined(SQLITE_OS_UNIX) && OS_UNIX && SQLITE_THREADSAFE */
|
||||
#endif /* defined(SQLITE_SERVER) */
|
||||
|
||||
Reference in New Issue
Block a user