aboutsummaryrefslogtreecommitdiff
path: root/sqlite3.go
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2014-10-20 15:19:03 +0900
committermattn <mattn.jp@gmail.com>2014-10-20 15:19:03 +0900
commit1fbcb3cdc2433e50534afbd3f00447dba3eecfaf (patch)
treeae5d0f60655c3c90774afbbb0c738e1927261c60 /sqlite3.go
parentMerge pull request #152 from rhomel/master (diff)
downloadgolite-1fbcb3cdc2433e50534afbd3f00447dba3eecfaf.tar.gz
golite-1fbcb3cdc2433e50534afbd3f00447dba3eecfaf.tar.xz
Thread safe
Diffstat (limited to 'sqlite3.go')
-rw-r--r--sqlite3.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/sqlite3.go b/sqlite3.go
index 24b6cfd..15c7003 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -6,13 +6,17 @@
package sqlite3
/*
-#ifdef _WIN32
-# define _localtime32(x) localtime(x)
-#endif
#include <sqlite3.h>
#include <stdlib.h>
#include <string.h>
+#ifdef _WIN32
+#include <time.h>
+struct tm* _localtime32(const __time32_t *tm) {
+ return localtime(tm);
+}
+#endif
+
#ifdef __CYGWIN__
# include <errno.h>
#endif
@@ -25,6 +29,10 @@ package sqlite3
# define SQLITE_OPEN_FULLMUTEX 0
#endif
+#ifndef SQLITE_THREADSAFE
+# define SQLITE_THREADSAFE
+#endif
+
static int
_sqlite3_open_v2(const char *filename, sqlite3 **ppDb, int flags, const char *zVfs) {
#ifdef SQLITE_OPEN_URI