mirror of https://github.com/mattn/go-sqlite3.git
Use sqlite3.c in all platforms
This commit is contained in:
parent
a3e3a8e981
commit
691a8a9de3
|
@ -11,7 +11,7 @@ func main() {
|
|||
sql.Register("sqlite3_with_extensions",
|
||||
&sqlite3.SQLiteDriver{
|
||||
Extensions: []string{
|
||||
"sqlite3_mod_regexp.dll",
|
||||
"sqlite3_mod_regexp",
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <regex.h>
|
||||
#include <pcre.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <sqlite3ext.h>
|
||||
|
@ -21,7 +21,11 @@ static void regexp_func(sqlite3_context *context, int argc, sqlite3_value **argv
|
|||
sqlite3_result_int(context, 1);
|
||||
}
|
||||
}
|
||||
__declspec(dllexport) int sqlite3_extension_init(sqlite3 *db, char **errmsg, const sqlite3_api_routines *api) {
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
int sqlite3_extension_init(sqlite3 *db, char **errmsg, const sqlite3_api_routines *api) {
|
||||
SQLITE_EXTENSION_INIT2(api);
|
||||
return sqlite3_create_function(db, "regexp", 2, SQLITE_UTF8, (void*)db, regexp_func, NULL, NULL);
|
||||
}
|
|
@ -3,6 +3,6 @@
|
|||
package sqlite3
|
||||
|
||||
/*
|
||||
#cgo pkg-config: sqlite3
|
||||
#cgo LDFLAGS: -v -ldl
|
||||
*/
|
||||
import "C"
|
||||
|
|
Loading…
Reference in New Issue