Index: Makefile.arm-wince-mingw32ce-gcc ================================================================== --- Makefile.arm-wince-mingw32ce-gcc +++ Makefile.arm-wince-mingw32ce-gcc @@ -61,11 +61,11 @@ # with -DNDEBUG=1 # #OPTS = -DSQLITE_DEBUG=2 #OPTS = -DSQLITE_DEBUG=1 #OPTS = -OPTS = -DNDEBUG=1 -DOS_WIN=1 -D_WIN32_WCE=1 +OPTS = -DNDEBUG=1 -DSQLITE_OS_WIN=1 -D_WIN32_WCE=1 #OPTS += -DHAVE_FDATASYNC=1 #### The suffix to add to executable files. ".exe" for windows. # Nothing for unix. # Index: configure ================================================================== --- configure +++ configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for sqlite 3.5.9. +# Generated by GNU Autoconf 2.59 for sqlite 3.6.0. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -414,12 +414,12 @@ : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.5.9' -PACKAGE_STRING='sqlite 3.5.9' +PACKAGE_VERSION='3.6.0' +PACKAGE_STRING='sqlite 3.6.0' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include @@ -455,11 +455,11 @@ #endif #if HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LIBTOOL build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S AR ac_ct_AR STRIP ac_ct_STRIP RANLIB ac_ct_RANLIB lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK TCLSH_CMD program_prefix VERSION RELEASE VERSION_NUMBER BUILD_CC SQLITE_THREADSAFE XTHREADCONNECT THREADSOVERRIDELOCKS ALLOWRELEASE TEMP_STORE BUILD_EXEEXT OS_UNIX OS_WIN OS_OS2 TARGET_EXEEXT TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIBS TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC HAVE_TCL TARGET_READLINE_LIBS TARGET_READLINE_INC TARGET_HAVE_READLINE TARGET_DEBUG USE_AMALGAMATION LOADEXTENSION_FLAGS USE_GCOV BUILD_CFLAGS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LIBTOOL build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S AR ac_ct_AR STRIP ac_ct_STRIP RANLIB ac_ct_RANLIB lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK TCLSH_CMD program_prefix VERSION RELEASE VERSION_NUMBER BUILD_CC SQLITE_THREADSAFE XTHREADCONNECT THREADSOVERRIDELOCKS ALLOWRELEASE TEMP_STORE BUILD_EXEEXT SQLITE_OS_UNIX SQLITE_OS_WIN SQLITE_OS_OS2 TARGET_EXEEXT TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIBS TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC HAVE_TCL TARGET_READLINE_LIBS TARGET_READLINE_INC TARGET_HAVE_READLINE TARGET_DEBUG USE_AMALGAMATION LOADEXTENSION_FLAGS USE_GCOV BUILD_CFLAGS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false @@ -924,11 +924,11 @@ # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.5.9 to adapt to many kinds of systems. +\`configure' configures sqlite 3.6.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. @@ -985,11 +985,11 @@ _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.5.9:";; + short | recursive ) echo "Configuration of sqlite 3.6.0:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) @@ -1135,11 +1135,11 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.5.9 +sqlite configure 3.6.0 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -1149,11 +1149,11 @@ exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.5.9, which was +It was created by sqlite $as_me 3.6.0, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF @@ -1487,11 +1487,11 @@ # The following RCS revision string applies to configure.in -# $Revision: 1.60 $ +# $Revision: 1.61 $ ######### # Programs needed # case `pwd` in @@ -11259,31 +11259,31 @@ else TARGET_EXEEXT=$config_TARGET_EXEEXT fi if test "$TARGET_EXEEXT" = ".exe"; then if test $OS2_SHELL ; then - OS_UNIX=0 - OS_WIN=0 - OS_OS2=1 - CFLAGS="$CFLAGS -DOS_OS2=1" + SQLITE_OS_UNIX=0 + SQLITE_OS_WIN=0 + SQLITE_OS_OS2=1 + CFLAGS="$CFLAGS -DSQLITE_OS_OS2=1" if test "$ac_compiler_gnu" = "yes" ; then CFLAGS="$CFLAGS -Zomf -Zexe -Zmap" BUILD_CFLAGS="$BUILD_CFLAGS -Zomf -Zexe" fi else - OS_UNIX=0 - OS_WIN=1 - OS_OS2=0 + SQLITE_OS_UNIX=0 + SQLITE_OS_WIN=1 + SQLITE_OS_OS2=0 tclsubdir=win - CFLAGS="$CFLAGS -DOS_WIN=1" + CFLAGS="$CFLAGS -DSQLITE_OS_WIN=1" fi else - OS_UNIX=1 - OS_WIN=0 - OS_OS2=0 + SQLITE_OS_UNIX=1 + SQLITE_OS_WIN=0 + SQLITE_OS_OS2=0 tclsubdir=unix - CFLAGS="$CFLAGS -DOS_UNIX=1" + CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1" fi @@ -12459,11 +12459,11 @@ ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by sqlite $as_me 3.5.9, which was +This file was extended by sqlite $as_me 3.6.0, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -12522,11 +12522,11 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -sqlite config.status 3.5.9 +sqlite config.status 3.6.0 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation @@ -13032,13 +13032,13 @@ s,@XTHREADCONNECT@,$XTHREADCONNECT,;t t s,@THREADSOVERRIDELOCKS@,$THREADSOVERRIDELOCKS,;t t s,@ALLOWRELEASE@,$ALLOWRELEASE,;t t s,@TEMP_STORE@,$TEMP_STORE,;t t s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t -s,@OS_UNIX@,$OS_UNIX,;t t -s,@OS_WIN@,$OS_WIN,;t t -s,@OS_OS2@,$OS_OS2,;t t +s,@SQLITE_OS_UNIX@,$SQLITE_OS_UNIX,;t t +s,@SQLITE_OS_WIN@,$SQLITE_OS_WIN,;t t +s,@SQLITE_OS_OS2@,$SQLITE_OS_OS2,;t t s,@TARGET_EXEEXT@,$TARGET_EXEEXT,;t t s,@TCL_VERSION@,$TCL_VERSION,;t t s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t s,@TCL_LIBS@,$TCL_LIBS,;t t Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -90,11 +90,11 @@ AC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n'])) dnl Put the RCS revision string after AC_INIT so that it will also dnl show in in configure. # The following RCS revision string applies to configure.in -# $Revision: 1.45 $ +# $Revision: 1.46 $ ######### # Programs needed # AC_PROG_LIBTOOL @@ -338,37 +338,37 @@ else TARGET_EXEEXT=$config_TARGET_EXEEXT fi if test "$TARGET_EXEEXT" = ".exe"; then if test $OS2_SHELL ; then - OS_UNIX=0 - OS_WIN=0 - OS_OS2=1 - CFLAGS="$CFLAGS -DOS_OS2=1" + SQLITE_OS_UNIX=0 + SQLITE_OS_WIN=0 + SQLITE_OS_OS2=1 + CFLAGS="$CFLAGS -DSQLITE_OS_OS2=1" if test "$ac_compiler_gnu" = "yes" ; then CFLAGS="$CFLAGS -Zomf -Zexe -Zmap" BUILD_CFLAGS="$BUILD_CFLAGS -Zomf -Zexe" fi else - OS_UNIX=0 - OS_WIN=1 - OS_OS2=0 + SQLITE_OS_UNIX=0 + SQLITE_OS_WIN=1 + SQLITE_OS_OS2=0 tclsubdir=win - CFLAGS="$CFLAGS -DOS_WIN=1" + CFLAGS="$CFLAGS -DSQLITE_OS_WIN=1" fi else - OS_UNIX=1 - OS_WIN=0 - OS_OS2=0 + SQLITE_OS_UNIX=1 + SQLITE_OS_WIN=0 + SQLITE_OS_OS2=0 tclsubdir=unix - CFLAGS="$CFLAGS -DOS_UNIX=1" + CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1" fi AC_SUBST(BUILD_EXEEXT) -AC_SUBST(OS_UNIX) -AC_SUBST(OS_WIN) -AC_SUBST(OS_OS2) +AC_SUBST(SQLITE_OS_UNIX) +AC_SUBST(SQLITE_OS_WIN) +AC_SUBST(SQLITE_OS_OS2) AC_SUBST(TARGET_EXEEXT) ########## # Figure out all the parameters needed to compile against Tcl. # Index: mkdll.sh ================================================================== --- mkdll.sh +++ mkdll.sh @@ -8,11 +8,11 @@ # make sqlite3.c PATH=$PATH:/opt/mingw/bin TCLDIR=/home/drh/tcltk/846/win/846win TCLSTUBLIB=$TCLDIR/libtcl84stub.a -OPTS='-DUSE_TCL_STUBS=1 -DSQLITE_THREADSAFE=1 -DBUILD_sqlite=1 -DOS_WIN=1' +OPTS='-DUSE_TCL_STUBS=1 -DSQLITE_THREADSAFE=1 -DBUILD_sqlite=1 -DSQLITE_OS_WIN=1' OPTS="$OPTS -DSQLITE_ENABLE_FTS3=1" CC="i386-mingw32msvc-gcc -Os $OPTS -Itsrc -I$TCLDIR" NM="i386-mingw32msvc-nm" CMD="$CC -c sqlite3.c" echo $CMD Index: mkextw.sh ================================================================== --- mkextw.sh +++ mkextw.sh @@ -2,11 +2,11 @@ # # This script is used to compile SQLite extensions into DLLs. # make fts2amal.c PATH=$PATH:/opt/mingw/bin -OPTS='-DTHREADSAFE=1 -DBUILD_sqlite=1 -DOS_WIN=1' +OPTS='-DTHREADSAFE=1 -DBUILD_sqlite=1 -DSQLITE_OS_WIN=1' CC="i386-mingw32msvc-gcc -O2 $OPTS -Itsrc" NM="i386-mingw32msvc-nm" CMD="$CC -c fts2amal.c" echo $CMD $CMD Index: src/main.c ================================================================== --- src/main.c +++ src/main.c @@ -12,11 +12,11 @@ ** Main file for the SQLite library. The routines in this file ** implement the programmer interface to the library. Routines in ** 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 #ifdef SQLITE_ENABLE_FTS3 @@ -522,11 +522,11 @@ */ 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[] = { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228 }; # define NDELAY (sizeof(delays)/sizeof(delays[0])) Index: src/mutex.h ================================================================== --- src/mutex.h +++ src/mutex.h @@ -17,11 +17,11 @@ ** ** NOTE: source files should *not* #include this header file directly. ** 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 $ */ #ifdef SQLITE_MUTEX_APPDEF /* @@ -51,19 +51,19 @@ #define SQLITE_MUTEX_NOOP 1 /* The default */ #if defined(SQLITE_DEBUG) && !SQLITE_THREADSAFE # 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 #ifdef SQLITE_MUTEX_NOOP Index: src/mutex_w32.c ================================================================== --- src/mutex_w32.c +++ src/mutex_w32.c @@ -9,11 +9,11 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** 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" /* ** The code in this file is only used if we are compiling multithreaded @@ -40,11 +40,11 @@ ** API as long as we don't call it win running Win95/98/ME. A call to ** this routine is used to determine if the host is Win95/98/ME or ** 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){ static int osType = 0; if( osType==0 ){ @@ -53,11 +53,11 @@ GetVersionEx(&sInfo); osType = sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT ? 2 : 1; } return osType==2; } -#endif /* OS_WINCE */ +#endif /* SQLITE_OS_WINCE */ #ifdef SQLITE_DEBUG /* ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are Index: src/os.c ================================================================== --- src/os.c +++ src/os.c @@ -11,11 +11,11 @@ ****************************************************************************** ** ** 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" #undef _SQLITE_OS_C_ @@ -34,11 +34,11 @@ ** sqlite3OsWrite() ** sqlite3OsSync() ** 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; \ sqlite3_free(pTstAlloc); \ } Index: src/os.h ================================================================== --- src/os.h +++ src/os.h @@ -15,77 +15,78 @@ ** the SQLite library will work on both POSIX and windows systems. ** ** 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_ /* ** 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 /* ** Determine if we are dealing with WindowsCE - which has a much ** 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 # 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 /* has to be included before os2.h for linking to work */ # endif # define INCL_DOSDATETIME # define INCL_DOSFILEMGR Index: src/os_os2.c ================================================================== --- src/os_os2.c +++ src/os_os2.c @@ -10,16 +10,16 @@ ** ****************************************************************************** ** ** 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: ** ** This driver uses malloc()/free() directly rather than going through @@ -1075,6 +1075,6 @@ } int sqlite3_os_end(void){ return SQLITE_OK; } -#endif /* OS_OS2 */ +#endif /* SQLITE_OS_OS2 */ Index: src/os_unix.c ================================================================== --- src/os_unix.c +++ src/os_unix.c @@ -10,14 +10,14 @@ ** ****************************************************************************** ** ** 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 */ /* ** These #defines should enable >2GB file support on Posix if the @@ -2809,6 +2809,6 @@ } int sqlite3_os_end(void){ return SQLITE_OK; } -#endif /* OS_UNIX */ +#endif /* SQLITE_OS_UNIX */ Index: src/os_win.c ================================================================== --- src/os_win.c +++ src/os_win.c @@ -10,14 +10,14 @@ ** ****************************************************************************** ** ** 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 */ /* ** A Note About Memory Allocation: ** @@ -64,19 +64,19 @@ /* ** 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 /* ** 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 */ BOOL bReserved; /* Indicates a reserved lock has been obtained */ BOOL bExclusive; /* Indicates an exclusive lock has been obtained */ @@ -91,11 +91,11 @@ struct winFile { const sqlite3_io_methods *pMethod;/* Must be first */ 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 */ winceLock local; /* Locks obtained by this instance of winFile */ winceLock *shared; /* Global shared lock memory for the file */ @@ -130,11 +130,11 @@ ** API as long as we don't call it win running Win95/98/ME. A call to ** this routine is used to determine if the host is Win95/98/ME or ** 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){ if( sqlite3_os_type==0 ){ OSVERSIONINFO sInfo; @@ -142,11 +142,11 @@ GetVersionEx(&sInfo); sqlite3_os_type = sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT ? 2 : 1; } return sqlite3_os_type==2; } -#endif /* OS_WINCE */ +#endif /* SQLITE_OS_WINCE */ /* ** Convert a UTF-8 string to microsoft unicode (UTF-16?). ** ** Space to hold the returned string is obtained from malloc. @@ -273,11 +273,11 @@ zFilenameMbcs = unicodeToMbcs(zTmpWide); free(zTmpWide); return zFilenameMbcs; } -#if OS_WINCE +#if SQLITE_OS_WINCE /************************************************************************* ** This section contains code for WinCE only. */ /* ** WindowsCE does not have a localtime() function. So create a @@ -577,11 +577,11 @@ return FALSE; } /* ** 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 ** by the sqlite3_io_methods object. ******************************************************************************/ @@ -602,11 +602,11 @@ winFile *pFile = (winFile*)id; OSTRACE2("CLOSE %d\n", pFile->h); 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 ){ int cnt = 0; while( @@ -1177,11 +1177,11 @@ dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; }else{ dwShareMode = 0; } if( flags & SQLITE_OPEN_DELETEONCLOSE ){ -#if OS_WINCE +#if SQLITE_OS_WINCE dwFlagsAndAttributes = FILE_ATTRIBUTE_HIDDEN; #else dwFlagsAndAttributes = FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_HIDDEN | FILE_FLAG_DELETE_ON_CLOSE; @@ -1202,11 +1202,11 @@ dwCreationDisposition, dwFlagsAndAttributes, NULL ); }else{ -#if OS_WINCE +#if SQLITE_OS_WINCE return SQLITE_NOMEM; #else h = CreateFileA((char*)zConverted, dwDesiredAccess, dwShareMode, @@ -1234,11 +1234,11 @@ } } 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) ){ CloseHandle(h); @@ -1285,11 +1285,11 @@ do{ DeleteFileW(zConverted); }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{ DeleteFileA(zConverted); }while( (rc = GetFileAttributesA(zConverted))!=0xffffffff @@ -1317,11 +1317,11 @@ return SQLITE_NOMEM; } if( isNT() ){ attr = GetFileAttributesW((WCHAR*)zConverted); }else{ -#if OS_WINCE +#if SQLITE_OS_WINCE return SQLITE_NOMEM; #else attr = GetFileAttributesA((char*)zConverted); #endif } @@ -1357,17 +1357,17 @@ #if defined(__CYGWIN__) cygwin_conv_to_full_win32_path(zRelative, zFull); 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; zConverted = convertUtf8Filename(zRelative); if( isNT() ){ @@ -1421,21 +1421,21 @@ return 0; } if( isNT() ){ h = LoadLibraryW((WCHAR*)zConverted); }else{ -#if OS_WINCE +#if SQLITE_OS_WINCE return 0; #else h = LoadLibraryA((char*)zConverted); #endif } free(zConverted); 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); }else{ sqlite3_snprintf(nBuf, zBufOut, "OsError %d", error); @@ -1451,11 +1451,11 @@ 0 ); #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 /* All other windows platforms expect GetProcAddress() to take ** an Ansi string regardless of the _UNICODE setting */ @@ -1529,11 +1529,11 @@ FILETIME ft; /* FILETIME structure is a 64-bit value representing the number of 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); #else GetSystemTimeAsFileTime( &ft ); @@ -1582,6 +1582,6 @@ } int sqlite3_os_end(void){ return SQLITE_OK; } -#endif /* OS_WIN */ +#endif /* SQLITE_OS_WIN */ Index: src/shell.c ================================================================== --- src/shell.c +++ src/shell.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** 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 #include #include #include @@ -1944,11 +1944,11 @@ i++; zInitFile = argv[i]; } } if( i #include @@ -4734,14 +4734,14 @@ extern int sqlite3_xferopt_count; extern int sqlite3_pager_readdb_count; 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 extern int sqlite3WhereTrace; extern int sqlite3OSTrace; @@ -4786,19 +4786,19 @@ (char*)&sqlite3_pager_pgfree_count, TCL_LINK_INT); #ifndef SQLITE_OMIT_UTF16 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 #ifndef SQLITE_OMIT_UTF16 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 #ifdef SQLITE_TEST Tcl_LinkVar(interp, "sqlite_query_plan", Index: src/test4.c ================================================================== --- src/test4.c +++ src/test4.c @@ -9,15 +9,15 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** 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 #include #include #include #include @@ -711,6 +711,6 @@ } return TCL_OK; } #else int Sqlitetest4_Init(Tcl_Interp *interp){ return TCL_OK; } -#endif /* OS_UNIX */ +#endif /* SQLITE_OS_UNIX */ Index: src/test7.c ================================================================== --- src/test7.c +++ src/test7.c @@ -10,21 +10,21 @@ ** ************************************************************************* ** 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" /* ** This test only works on UNIX with a SQLITE_THREADSAFE build that includes ** 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 #include #include #include @@ -718,6 +718,6 @@ } return TCL_OK; } #else int Sqlitetest7_Init(Tcl_Interp *interp){ return TCL_OK; } -#endif /* OS_UNIX */ +#endif /* SQLITE_OS_UNIX */ Index: src/test_async.c ================================================================== --- src/test_async.c +++ src/test_async.c @@ -8,11 +8,11 @@ ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** -** $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. ** ** WHAT IS ASYNCHRONOUS I/O? @@ -115,11 +115,11 @@ /* ** 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 ** for your operating system, you will need to recode the threading ** logic. @@ -1694,24 +1694,24 @@ } return TCL_OK; } -#endif /* OS_UNIX and SQLITE_THREADSAFE */ +#endif /* SQLITE_OS_UNIX and SQLITE_THREADSAFE */ /* ** This routine registers the custom TCL commands defined in this ** module. This should be the only procedure visible from outside ** 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); Tcl_CreateObjCommand(interp,"sqlite3async_start",testAsyncStart,0,0); 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; } Index: src/test_config.c ================================================================== --- src/test_config.c +++ src/test_config.c @@ -14,11 +14,11 @@ ** None of the code in this file goes into a deliverable build. ** ** 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" #include "sqliteInt.h" @@ -181,11 +181,11 @@ Tcl_SetVar2(interp, "sqlite_options", "conflict", "0", TCL_GLOBAL_ONLY); #else 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); #endif Index: src/test_server.c ================================================================== --- src/test_server.c +++ src/test_server.c @@ -8,11 +8,11 @@ ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** -** $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: ** ** -DSQLITE_SERVER=1 @@ -206,11 +206,11 @@ /* ** Only compile the code in this file on UNIX with a SQLITE_THREADSAFE build ** 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. */ #include @@ -487,7 +487,7 @@ pthread_cond_broadcast(&g.serverWakeup); pthread_mutex_lock(&g.serverMutex); 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) */ Index: tool/omittest.tcl ================================================================== --- tool/omittest.tcl +++ tool/omittest.tcl @@ -1,7 +1,7 @@ -set rcsid {$Id: omittest.tcl,v 1.3 2007/09/14 16:20:01 danielk1977 Exp $} +set rcsid {$Id: omittest.tcl,v 1.4 2008/06/26 10:41:19 danielk1977 Exp $} # Documentation for this script. This may be output to stderr # if the script is invoked incorrectly. set ::USAGE_MESSAGE { This Tcl script is used to test the various compile time options @@ -45,11 +45,11 @@ # run_quick_test /tmp/testdir {SQLITE_OMIT_TRIGGER SQLITE_OMIT_VIEW} # # proc run_quick_test {dir omit_symbol_list} { # Compile the value of the OPTS Makefile variable. - set opts "-DSQLITE_MEMDEBUG=2 -DSQLITE_DEBUG -DOS_UNIX" + set opts "-DSQLITE_MEMDEBUG=2 -DSQLITE_DEBUG -DSQLITE_OS_UNIX" foreach sym $omit_symbol_list { append opts " -D${sym}=1" } # Create the directory and do the build. If an error occurs return Index: tool/soak1.tcl ================================================================== --- tool/soak1.tcl +++ tool/soak1.tcl @@ -76,11 +76,11 @@ SQLITE_ENABLE_LOAD_EXTENSION=1 HAVE_DLOPEN=1 SQLITE_ENABLE_MEMORY_MANAGEMENT=1 } scenario 3 {Customer-1} { SQLITE_DEBUG=1 SQLITE_MEMDEBUG=1 - THREADSAFE=1 OS_UNIX=1 + THREADSAFE=1 SQLITE_OS_UNIX=1 SQLITE_DISABLE_LFS=1 SQLITE_DEFAULT_AUTOVACUUM=1 SQLITE_DEFAULT_PAGE_SIZE=1024 SQLITE_MAX_PAGE_SIZE=4096 SQLITE_DEFAULT_CACHE_SIZE=64 @@ -91,13 +91,13 @@ SQLITE_OMIT_VIRTUALTABLE=1 SQLITE_ENABLE_IOTRACE=1 } scenario 4 {Small-Cache} { SQLITE_DEBUG=1 SQLITE_MEMDEBUG=1 - THREADSAFE=1 OS_UNIX=1 + THREADSAFE=1 SQLITE_OS_UNIX=1 SQLITE_DEFAULT_AUTOVACUUM=1 SQLITE_DEFAULT_PAGE_SIZE=1024 SQLITE_MAX_PAGE_SIZE=2048 SQLITE_DEFAULT_CACHE_SIZE=13 SQLITE_DEFAULT_TEMP_CACHE_SIZE=11 TEMP_STORE=1 }