Index: third_party/sqlite/src/tool/mksqlite3h.tcl |
diff --git a/third_party/sqlite/src/tool/mksqlite3h.tcl b/third_party/sqlite/src/tool/mksqlite3h.tcl |
index 58fe8a89057004ac0c46b7d757abbce94567780b..554069c32398ce78ef236cc8aad23b0e48406b56 100644 |
--- a/third_party/sqlite/src/tool/mksqlite3h.tcl |
+++ b/third_party/sqlite/src/tool/mksqlite3h.tcl |
@@ -53,7 +53,7 @@ set in [open $TOP/manifest] |
set zDate {} |
while {![eof $in]} { |
set line [gets $in] |
- if {[regexp {^D (2.*[0-9])} $line all date]} { |
+ if {[regexp {^D (2[-0-9T:]+)} $line all date]} { |
set zDate [string map {T { }} $date] |
break |
} |
@@ -65,32 +65,39 @@ close $in |
set varpattern {^[a-zA-Z][a-zA-Z_0-9 *]+sqlite3_[_a-zA-Z0-9]+(\[|;| =)} |
set declpattern {^ *[a-zA-Z][a-zA-Z_0-9 ]+ \**sqlite3_[_a-zA-Z0-9]+\(} |
-# Process the src/sqlite.h.in file. |
+# Process the src/sqlite.h.in ext/rtree/sqlite3rtree.h files. |
# |
-set in [open $TOP/src/sqlite.h.in] |
-while {![eof $in]} { |
- |
- set line [gets $in] |
- |
- regsub -- --VERS-- $line $zVersion line |
- regsub -- --VERSION-NUMBER-- $line $nVersion line |
- regsub -- --SOURCE-ID-- $line "$zDate $zUuid" line |
+foreach file [list $TOP/src/sqlite.h.in $TOP/ext/rtree/sqlite3rtree.h] { |
+ set in [open $file] |
+ while {![eof $in]} { |
+ |
+ set line [gets $in] |
- if {[regexp {define SQLITE_EXTERN extern} $line]} { |
+ # File sqlite3rtree.h contains a line "#include <sqlite3.h>". Omit this |
+ # line when copying sqlite3rtree.h into sqlite3.h. |
+ # |
+ if {[string match {*#include*<sqlite3.h>*} $line]} continue |
+ |
+ regsub -- --VERS-- $line $zVersion line |
+ regsub -- --VERSION-NUMBER-- $line $nVersion line |
+ regsub -- --SOURCE-ID-- $line "$zDate $zUuid" line |
+ |
+ if {[regexp {define SQLITE_EXTERN extern} $line]} { |
+ puts $line |
+ puts [gets $in] |
+ puts "" |
+ puts "#ifndef SQLITE_API" |
+ puts "# define SQLITE_API" |
+ puts "#endif" |
+ set line "" |
+ } |
+ |
+ if {([regexp $varpattern $line] && ![regexp {^ *typedef} $line]) |
+ || ([regexp $declpattern $line]) |
+ } { |
+ set line "SQLITE_API $line" |
+ } |
puts $line |
- puts [gets $in] |
- puts "" |
- puts "#ifndef SQLITE_API" |
- puts "# define SQLITE_API" |
- puts "#endif" |
- set line "" |
} |
- |
- if {([regexp $varpattern $line] && ![regexp {^ *typedef} $line]) |
- || ([regexp $declpattern $line]) |
- } { |
- set line "SQLITE_API $line" |
- } |
- puts $line |
+ close $in |
} |
-close $in |