| Index: third_party/sqlite/src/tool/mksqlite3c.tcl
|
| diff --git a/third_party/sqlite/src/tool/mksqlite3c.tcl b/third_party/sqlite/src/tool/mksqlite3c.tcl
|
| index 23241e27a6ee4fa79e1c92f31c575f5c7a40b988..55179c4b80b1988462c31cfd224b48af5e7cda10 100644
|
| --- a/third_party/sqlite/src/tool/mksqlite3c.tcl
|
| +++ b/third_party/sqlite/src/tool/mksqlite3c.tcl
|
| @@ -1,7 +1,7 @@
|
| #!/usr/bin/tclsh
|
| #
|
| # To build a single huge source file holding all of SQLite (or at
|
| -# least the core components - the test harness, shell, and TCL
|
| +# least the core components - the test harness, shell, and TCL
|
| # interface are omitted.) first do
|
| #
|
| # make target_source
|
| @@ -11,7 +11,7 @@
|
| # there and will not work if they are not found.) There are a few
|
| # generated C code files that are also added to the tsrc directory.
|
| # For example, the "parse.c" and "parse.h" files to implement the
|
| -# the parser are derived from "parse.y" using lemon. And the
|
| +# the parser are derived from "parse.y" using lemon. And the
|
| # "keywordhash.h" files is generated by a program named "mkkeywordhash".
|
| #
|
| # After the "tsrc" directory has been created and populated, run
|
| @@ -28,12 +28,15 @@
|
| #
|
| set addstatic 1
|
| set linemacros 0
|
| +set useapicall 0
|
| for {set i 0} {$i<[llength $argv]} {incr i} {
|
| set x [lindex $argv $i]
|
| if {[regexp {^-+nostatic$} $x]} {
|
| set addstatic 0
|
| } elseif {[regexp {^-+linemacros} $x]} {
|
| set linemacros 1
|
| + } elseif {[regexp {^-+useapicall} $x]} {
|
| + set useapicall 1
|
| } else {
|
| error "unknown command-line option: $x"
|
| }
|
| @@ -59,7 +62,7 @@ set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1]
|
| puts $out [subst \
|
| {/******************************************************************************
|
| ** This file is an amalgamation of many separate C source files from SQLite
|
| -** version $VERSION. By combining all the individual C code files into this
|
| +** version $VERSION. By combining all the individual C code files into this
|
| ** single large file, the entire code can be compiled as a single translation
|
| ** unit. This allows many compilers to do optimizations that would not be
|
| ** possible if the files were compiled separately. Performance improvements
|
| @@ -68,7 +71,7 @@ puts $out [subst \
|
| **
|
| ** This file is all you need to compile SQLite. To use SQLite in other
|
| ** programs, you need this file and the "sqlite3.h" header file that defines
|
| -** the programming interface to the SQLite library. (If you do not have
|
| +** the programming interface to the SQLite library. (If you do not have
|
| ** the "sqlite3.h" header file at hand, you will find a copy embedded within
|
| ** the text of this file. Search for "Begin file sqlite3.h" to find the start
|
| ** of the embedded sqlite3.h header file.) Additional code files may be needed
|
| @@ -85,7 +88,7 @@ if {$addstatic} {
|
| #endif}
|
| }
|
|
|
| -# These are the header files used by SQLite. The first time any of these
|
| +# These are the header files used by SQLite. The first time any of these
|
| # files are seen in a #include statement in the C code, include the complete
|
| # text of the file in-line. The file only needs to be included once.
|
| #
|
| @@ -111,6 +114,7 @@ foreach hdr {
|
| pcache.h
|
| pragma.h
|
| rtree.h
|
| + sqlite3session.h
|
| sqlite3.h
|
| sqlite3ext.h
|
| sqlite3rbu.h
|
| @@ -126,6 +130,7 @@ foreach hdr {
|
| set available_hdr($hdr) 1
|
| }
|
| set available_hdr(sqliteInt.h) 0
|
| +set available_hdr(sqlite3session.h) 0
|
|
|
| # These headers should be copied into the amalgamation without modifying any
|
| # of their function declarations or definitions.
|
| @@ -163,7 +168,8 @@ proc section_comment {text} {
|
| # process them appropriately.
|
| #
|
| proc copy_file {filename} {
|
| - global seen_hdr available_hdr varonly_hdr cdecllist out addstatic linemacros
|
| + global seen_hdr available_hdr varonly_hdr cdecllist out
|
| + global addstatic linemacros useapicall
|
| set ln 0
|
| set tail [file tail $filename]
|
| section_comment "Begin file $tail"
|
| @@ -220,18 +226,20 @@ proc copy_file {filename} {
|
| regsub {^SQLITE_API } $line {} line
|
| # Add the SQLITE_PRIVATE or SQLITE_API keyword before functions.
|
| # so that linkage can be modified at compile-time.
|
| - if {[regexp {^sqlite3(_|rbu_)} $funcname]} {
|
| + if {[regexp {^sqlite3[a-z]*_} $funcname]} {
|
| set line SQLITE_API
|
| append line " " [string trim $rettype]
|
| if {[string index $rettype end] ne "*"} {
|
| append line " "
|
| }
|
| - if {[lsearch -exact $cdecllist $funcname] >= 0} {
|
| - append line SQLITE_CDECL
|
| - } else {
|
| - append line SQLITE_STDCALL
|
| + if {$useapicall} {
|
| + if {[lsearch -exact $cdecllist $funcname] >= 0} {
|
| + append line SQLITE_CDECL " "
|
| + } else {
|
| + append line SQLITE_APICALL " "
|
| + }
|
| }
|
| - append line " " $funcname $rest
|
| + append line $funcname $rest
|
| puts $out $line
|
| } else {
|
| puts $out "SQLITE_PRIVATE $line"
|
| @@ -323,7 +331,6 @@ foreach file {
|
| vdbe.c
|
| vdbeblob.c
|
| vdbesort.c
|
| - journal.c
|
| memjournal.c
|
|
|
| walker.c
|
| @@ -379,6 +386,7 @@ foreach file {
|
| fts3_icu.c
|
| sqlite3rbu.c
|
| dbstat.c
|
| + sqlite3session.c
|
| json1.c
|
| fts5.c
|
| } {
|
|
|