1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Extend wasm build to enable inclusion of client-custom C code, initialized via the SQLITE_EXTRA_INIT mechanism, per discussion in [forum:1e1c04f3ed1bc96b|forum post 1e1c04f3ed1bc96b].

FossilOrigin-Name: 68a52cafff60f19c9c998133d04f192b1e8b23f78b8cee13807d76845ef5e13d
This commit is contained in:
stephan
2023-02-27 07:12:28 +00:00
parent d7ddec765c
commit 9885c76c4c
6 changed files with 113 additions and 57 deletions

View File

@ -0,0 +1,22 @@
/*
** If the canonical build process finds the file
** sqlite3_wasm_extra_init.c in the main wasm build directory, it
** arranges to include that file in the build of sqlite3.wasm and
** defines SQLITE_EXTRA_INIT=sqlite3_wasm_extra_init.
**
** sqlite3_wasm_extra_init() must be a function with this signature:
**
** int sqlite3_wasm_extra_init(const char *)
**
** and the sqlite3 library will call it with an argument of NULL one
** time during sqlite3_initialize(). If it returns non-0,
** initialization of the library will fail.
*/
#include "sqlite3.h"
#include <stdio.h>
int sqlite3_wasm_extra_init(const char *z){
fprintf(stderr,"%s: %s()\n", __FILE__, __func__);
return 0;
}