/ Check-in [7d38da3e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix some minor compile problems. (CVS 5248)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7d38da3eea9ce93f32e90fce0af5101e2cf12462
User & Date: drh 2008-06-19 16:07:07
Context
2008-06-19
17:54
Documentation and test-script updates. (CVS 5249) check-in: 68d4f795 user: drh tags: trunk
16:07
Fix some minor compile problems. (CVS 5248) check-in: 7d38da3e user: drh tags: trunk
15:44
Additional test cases for loadable extensions. (CVS 5247) check-in: 9d73a68c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/mutex_unix.c.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains the C functions that implement mutexes for pthreads
    13     13   **
    14         -** $Id: mutex_unix.c,v 1.11 2008/06/19 08:51:24 danielk1977 Exp $
           14  +** $Id: mutex_unix.c,v 1.12 2008/06/19 16:07:07 drh Exp $
    15     15   */
    16     16   #include "sqliteInt.h"
    17     17   
    18     18   /*
    19     19   ** The code in this file is only used if we are compiling threadsafe
    20     20   ** under unix with pthreads.
    21     21   **
................................................................................
   309    309       pthreadMutexInit,
   310    310       pthreadMutexEnd,
   311    311       pthreadMutexAlloc,
   312    312       pthreadMutexFree,
   313    313       pthreadMutexEnter,
   314    314       pthreadMutexTry,
   315    315       pthreadMutexLeave,
   316         -
          316  +#ifdef SQLITE_DEBUG
   317    317       pthreadMutexHeld,
   318    318       pthreadMutexNotheld
          319  +#endif
   319    320     };
   320    321   
   321    322     return &sMutex;
   322    323   }
   323    324   
   324    325   #endif /* SQLITE_MUTEX_PTHREAD */

Changes to src/mutex_w32.c.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains the C functions that implement mutexes for win32
    13     13   **
    14         -** $Id: mutex_w32.c,v 1.9 2008/06/19 08:51:24 danielk1977 Exp $
           14  +** $Id: mutex_w32.c,v 1.10 2008/06/19 16:07:07 drh Exp $
    15     15   */
    16     16   #include "sqliteInt.h"
    17     17   
    18     18   /*
    19     19   ** The code in this file is only used if we are compiling multithreaded
    20     20   ** on a win32 system.
    21     21   */
................................................................................
    53     53         GetVersionEx(&sInfo);
    54     54         osType = sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT ? 2 : 1;
    55     55       }
    56     56       return osType==2;
    57     57     }
    58     58   #endif /* OS_WINCE */
    59     59   
           60  +
           61  +#ifdef SQLITE_DEBUG
    60     62   /*
    61     63   ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
    62     64   ** intended for use only inside assert() statements.
    63     65   */
    64     66   static int winMutexHeld(sqlite3_mutex *p){
    65     67     return p->nRef!=0 && p->owner==GetCurrentThreadId();
    66     68   }
    67     69   static int winMutexNotheld(sqlite3_mutex *p){
    68     70     return p->nRef==0 || p->owner!=GetCurrentThreadId();
    69     71   }
           72  +#endif
    70     73   
    71     74   
    72     75   /*
    73     76   ** Initialize and deinitialize the mutex subsystem.
    74     77   */
    75     78   static int winMutexInit(void){ return SQLITE_OK; }
    76     79   static int winMutexEnd(void){ return SQLITE_OK; }
................................................................................
   226    229       winMutexInit,
   227    230       winMutexEnd,
   228    231       winMutexAlloc,
   229    232       winMutexFree,
   230    233       winMutexEnter,
   231    234       winMutexTry,
   232    235       winMutexLeave,
   233         -
          236  +#ifdef SQLITE_DEBUG
   234    237       winMutexHeld,
   235    238       winMutexNotheld
          239  +#endif
   236    240     };
   237    241   
   238    242     return &sMutex;
   239    243   }
   240    244   #endif /* SQLITE_MUTEX_W32 */
   241         -

Changes to src/os.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   ******************************************************************************
    12     12   **
    13     13   ** This file contains OS interface code that is common to all
    14     14   ** architectures.
    15     15   **
    16         -** $Id: os.c,v 1.114 2008/06/18 17:09:10 danielk1977 Exp $
           16  +** $Id: os.c,v 1.115 2008/06/19 16:07:07 drh Exp $
    17     17   */
    18     18   #define _SQLITE_OS_C_ 1
    19     19   #include "sqliteInt.h"
    20     20   #undef _SQLITE_OS_C_
    21     21   
    22     22   /*
    23     23   ** The default SQLite sqlite3_vfs implementations do not allocate
................................................................................
   195    195   static sqlite3_vfs *vfsList = 0;
   196    196   
   197    197   /*
   198    198   ** Locate a VFS by name.  If no name is given, simply return the
   199    199   ** first VFS on the list.
   200    200   */
   201    201   sqlite3_vfs *sqlite3_vfs_find(const char *zVfs){
          202  +  sqlite3_vfs *pVfs = 0;
          203  +  static int isInit = 0;
   202    204   #ifndef SQLITE_MUTEX_NOOP
   203    205     sqlite3_mutex *mutex;
   204    206   #endif
   205    207   #ifndef SQLITE_OMIT_AUTOINIT
   206    208     int rc = sqlite3_initialize();
   207    209     if( rc ) return 0;
   208    210   #endif
   209    211   #ifndef SQLITE_MUTEX_NOOP
   210    212     mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
   211    213   #endif
   212         -  sqlite3_vfs *pVfs = 0;
   213         -  static int isInit = 0;
   214    214     sqlite3_mutex_enter(mutex);
   215    215     if( !isInit ){
   216    216       vfsList = sqlite3OsDefaultVfs();
   217    217       isInit = 1;
   218    218     }
   219    219     for(pVfs = vfsList; pVfs; pVfs=pVfs->pNext){
   220    220       if( zVfs==0 ) break;