From 1fbcb3cdc2433e50534afbd3f00447dba3eecfaf Mon Sep 17 00:00:00 2001 From: mattn Date: Mon, 20 Oct 2014 15:19:03 +0900 Subject: [PATCH] Thread safe --- sqlite3.go | 14 +++++++++++--- 1 file 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 #include #include +#ifdef _WIN32 +#include +struct tm* _localtime32(const __time32_t *tm) { + return localtime(tm); +} +#endif + #ifdef __CYGWIN__ # include #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