]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix the shell.c.in amalgamator script so that it avoids generating
authordrh <drh@noemail.net>
Fri, 5 Jan 2018 20:30:54 +0000 (20:30 +0000)
committerdrh <drh@noemail.net>
Fri, 5 Jan 2018 20:30:54 +0000 (20:30 +0000)
redundant typedef statements.

FossilOrigin-Name: 6c53c740cb4f62305689ea0a73beca83e71ed86707094e850bed975965c8c9f2

manifest
manifest.uuid
tool/mkshellc.tcl

index bbcb9ab663c617fbc17747aa2beea42a9c48cfdb..9634780370f0275ad1ffb84b5fd90db1ce82c922 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C MinGW\sdoes\snot\sdefine\sthe\sS_ISLNK\smacro;\stherefore,\sdefine\sit\sin\sthe\sshell\swhen\sneeded.
-D 2018-01-05T20:26:06.480
+C Fix\sthe\sshell.c.in\samalgamator\sscript\sso\sthat\sit\savoids\sgenerating\nredundant\stypedef\sstatements.
+D 2018-01-05T20:30:54.903
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F Makefile.in c4a9842dcd07572a106da739fa4f76d5ae228e3c4c40c859c84ceaa71c36348e
@@ -1630,7 +1630,7 @@ F tool/mkopcodec.tcl d1b6362bd3aa80d5520d4d6f3765badf01f6c43c
 F tool/mkopcodeh.tcl 4ee2a30ccbd900dc4d5cdb61bdab87cd2166cd2affcc78c9cc0b8d22a65b2eee
 F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
 F tool/mkpragmatab.tcl 2144bc8550a6471a029db262a132d2df4b9e0db61b90398bf64f5b7b3f8d92cd
-F tool/mkshellc.tcl 574307265b49d813301fba91ccd74e6a26d33f65f74b6891c320a0ffbee07895
+F tool/mkshellc.tcl 8cb90170e4aed5bd26f1664a83727c5d451f86948d3b759be26c1d7879fa346f
 F tool/mksourceid.c d458f9004c837bee87a6382228ac20d3eae3c49ea3b0a5aace936f8b60748d3b
 F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
 F tool/mksqlite3c-noext.tcl fef88397668ae83166735c41af99d79f56afaabb
@@ -1694,7 +1694,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 5bc816ec4010c20407396a1051e9f9b0a360ca27c0a99dafa867225cf974e306
-R 1b1f2c1c694e2046fcfe9404f479b19a
-U mistachkin
-Z 8141067c4aab566b846a47904d7a2b0b
+P 73023febbe57495a22db05904bd6ddff439d6c25970cbe87e0ba4a923f3e8a29
+R 9251688fbd83640e3673feb22bd548ce
+U drh
+Z 4f1367bc1221f28464fd760bb035ab98
index c2654be9bec8d01c5939db4f620569ba622b92e5..3810fe573023f522c02b1071c65d9b5c4606a0dd 100644 (file)
@@ -1 +1 @@
-73023febbe57495a22db05904bd6ddff439d6c25970cbe87e0ba4a923f3e8a29
\ No newline at end of file
+6c53c740cb4f62305689ea0a73beca83e71ed86707094e850bed975965c8c9f2
\ No newline at end of file
index 807a169826137cef25cfb11e9b1af01693a06cc3..1a98511ef9d1dcfb54c3ae0aca2f07eaa02d2cbd 100644 (file)
@@ -30,15 +30,25 @@ puts $out {/* DO NOT EDIT!
 ** by "src/shell.c.in", then rerun the tool/mkshellc.tcl script.
 */}
 set in [open $topdir/src/shell.c.in rb]
+proc omit_redundant_typedefs {line} {
+  global typedef_seen
+  if {[regexp {^typedef .*;} $line]} {
+    if {[info exists typedef_seen($line)]} {
+      return "/* $line */"
+    }
+    set typedef_seen($line) 1
+  }
+  return $line
+}
 while {1} {
-  set lx [gets $in]
+  set lx [omit_redundant_typedefs [gets $in]]
   if {[eof $in]} break;
   if {[regexp {^INCLUDE } $lx]} {
     set cfile [lindex $lx 1]
     puts $out "/************************* Begin $cfile ******************/"
     set in2 [open $topdir/src/$cfile rb]
     while {![eof $in2]} {
-      set lx [gets $in2]
+      set lx [omit_redundant_typedefs [gets $in2]]
       if {[regexp {^#include "sqlite} $lx]} continue
       set lx [string map [list __declspec(dllexport) {}] $lx]
       puts $out $lx