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