From: larrybr Date: Sat, 8 Jan 2022 21:59:49 +0000 (+0000) Subject: mkshellc.tcl to convert #include to INCLUDE for in-tree includees X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ef4579896500ecdcd1005c7c912c5544ff29b73;p=thirdparty%2Fsqlite.git mkshellc.tcl to convert #include to INCLUDE for in-tree includees FossilOrigin-Name: b1f3b317c08f467fa8d4cbafdf08ef859b8f84ce371d19c13f87f7a1f2313b98 --- diff --git a/manifest b/manifest index 0fdde818c1..e78d1df5f5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Bring\sin\strunk\sshell\smods. -D 2022-01-02T00:16:09.068 +C mkshellc.tcl\sto\sconvert\s#include\sto\sINCLUDE\sfor\sin-tree\sincludees +D 2022-01-08T21:59:49.612 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1873,7 +1873,7 @@ F tool/mkopcodec.tcl 33d20791e191df43209b77d37f0ff0904620b28465cca6990cf8d60da61 F tool/mkopcodeh.tcl 130b88697da6ec5b89b41844d955d08fb62c2552e889dec8c7bcecb28d8f50bd F tool/mkopts.tcl 680f785fdb09729fd9ac50632413da4eadbdf9071535e3f26d03795828ab07fa F tool/mkpragmatab.tcl de206c64b6e9ac8cd5e3cbd0ffe456f07d5710605ef8385d677e60ce3335ea12 -F tool/mkshellc.tcl 005d8c68e4d22bf6739f6f95f61e269e2fa1d3c33596fb08e027acbd79c9e053 +F tool/mkshellc.tcl e02ca680bec146e483394fa2f6ce9f0ba6a34e7d4e9c9aa6ee87aab50ef4b141 F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9 F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6d0274f584a7f @@ -1939,8 +1939,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 653db501b46a4035ea1cb2f39862d781fa40fa0442a6abc84d32a9ac29e3af20 e199a851e316bd471bfc54204b8c250d3ae93b829261214158a2c74acad4093e -R 05e5f1a4d019a7b473688a3079da0d5e +P f628c3afd0a0527b1db7e3e117afc33a6cb929a507d1e32670e5fd5933fc4833 +R 59637fb955c3322a47f3cc2a0fb0721f U larrybr -Z 6520f133c5c5f2050f3ae99030c9a426 +Z 3a2f0529fc6b670cc5387b026b5b1a8a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 341c5b7102..c6ead6c284 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f628c3afd0a0527b1db7e3e117afc33a6cb929a507d1e32670e5fd5933fc4833 \ No newline at end of file +b1f3b317c08f467fa8d4cbafdf08ef859b8f84ce371d19c13f87f7a1f2313b98 \ No newline at end of file diff --git a/tool/mkshellc.tcl b/tool/mkshellc.tcl index 59565b4218..b14e517a00 100644 --- a/tool/mkshellc.tcl +++ b/tool/mkshellc.tcl @@ -624,7 +624,8 @@ proc do_macro {inSrc lx ostrm} { array set ::typedefsSeen {} # Filter redundant typedefs and certain includes and qualifiers, in place. -# Return whether anything changed. +# Return 1 if line can be emitted as-is, 0 if to be processed further. +# In either case, the line named by $lineVar may have been changed. proc transform_line {lineVar nesting} { upvar $lineVar line if {[regexp {^typedef .*;} $line]} { @@ -642,6 +643,15 @@ proc transform_line {lineVar nesting} { set line "/* $line */" return 1 } + if {$nesting > 0 && [regexp {^#include "([\w\.]+)"} $line _ incRelPath]} { + set fromPath [lindex $::incFileStack end] + set incPath [file join [file dirname $fromPath] $incRelPath] + set inTree [file exists $incPath] + if {$inTree} { + set line "INCLUDE $incRelPath" + return 0 + } + } if {[string first "__declspec(dllexport)" $line] >= 0} { set line [string map [list __declspec(dllexport) {}] $line] return 1