Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: third_party/sqlite/src/tool/mksqlite3c-noext.tcl

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/tool/mksqlite3c.tcl ('k') | third_party/sqlite/src/tool/mksqlite3h.tcl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/tool/mksqlite3c-noext.tcl
diff --git a/third_party/sqlite/src/tool/mksqlite3c-noext.tcl b/third_party/sqlite/src/tool/mksqlite3c-noext.tcl
index 601b8cce8c3e6d85d88c285c39909fb787c56e2d..a16b0591eb547e61b6270def640f57aaba3fbf0f 100644
--- a/third_party/sqlite/src/tool/mksqlite3c-noext.tcl
+++ b/third_party/sqlite/src/tool/mksqlite3c-noext.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
@@ -26,15 +26,20 @@
# from in this file. The version number is needed to generate the header
# comment of the amalgamation.
#
-if {[lsearch $argv --nostatic]>=0} {
- set addstatic 0
-} else {
- set addstatic 1
-}
-if {[lsearch $argv --linemacros]>=0} {
- set linemacros 1
-} else {
- set linemacros 0
+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"
+ }
}
set in [open tsrc/sqlite3.h]
set cnt 0
@@ -57,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
@@ -66,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
@@ -83,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.
#
@@ -104,8 +109,8 @@ foreach hdr {
parse.h
pcache.h
pragma.h
- sqlite3ext.h
sqlite3.h
+ sqlite3ext.h
sqliteicu.h
sqliteInt.h
sqliteLimit.h
@@ -155,7 +160,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"
@@ -203,7 +209,8 @@ proc copy_file {filename} {
puts $out "#if 0"
} elseif {!$linemacros && [regexp {^#line} $line]} {
# Skip #line directives.
- } elseif {$addstatic && ![regexp {^(static|typedef)} $line]} {
+ } elseif {$addstatic
+ && ![regexp {^(static|typedef|SQLITE_PRIVATE)} $line]} {
# Skip adding the SQLITE_PRIVATE or SQLITE_API keyword before
# functions if this header file does not need it.
if {![info exists varonly_hdr($tail)]
@@ -211,18 +218,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_} $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"
@@ -285,6 +294,7 @@ foreach file {
mutex_w32.c
malloc.c
printf.c
+ treeview.c
random.c
threads.c
utf.c
@@ -313,7 +323,6 @@ foreach file {
vdbe.c
vdbeblob.c
vdbesort.c
- journal.c
memjournal.c
walker.c
@@ -339,6 +348,8 @@ foreach file {
update.c
vacuum.c
vtab.c
+ wherecode.c
+ whereexpr.c
where.c
parse.c
« no previous file with comments | « third_party/sqlite/src/tool/mksqlite3c.tcl ('k') | third_party/sqlite/src/tool/mksqlite3h.tcl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698