Thread safe

This commit is contained in:
mattn 2014-10-20 15:19:03 +09:00
parent ea3ab4d8f5
commit 1fbcb3cdc2
1 changed files with 11 additions and 3 deletions

View File

@ -6,13 +6,17 @@
package sqlite3 package sqlite3
/* /*
#ifdef _WIN32
# define _localtime32(x) localtime(x)
#endif
#include <sqlite3.h> #include <sqlite3.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef _WIN32
#include <time.h>
struct tm* _localtime32(const __time32_t *tm) {
return localtime(tm);
}
#endif
#ifdef __CYGWIN__ #ifdef __CYGWIN__
# include <errno.h> # include <errno.h>
#endif #endif
@ -25,6 +29,10 @@ package sqlite3
# define SQLITE_OPEN_FULLMUTEX 0 # define SQLITE_OPEN_FULLMUTEX 0
#endif #endif
#ifndef SQLITE_THREADSAFE
# define SQLITE_THREADSAFE
#endif
static int static int
_sqlite3_open_v2(const char *filename, sqlite3 **ppDb, int flags, const char *zVfs) { _sqlite3_open_v2(const char *filename, sqlite3 **ppDb, int flags, const char *zVfs) {
#ifdef SQLITE_OPEN_URI #ifdef SQLITE_OPEN_URI