Modify the amalgamation generator to identify every API using the

SQLITE_API macro which is normally defined to nothing but which can
be overridden on the compiler command-line to be "static" if desired.
Ticket #2453. (CVS 4125)

FossilOrigin-Name: 474a52347d454ad499d7a78c88eb995c9d3254d1
This commit is contained in:
drh 2007-06-26 00:52:39 +00:00
parent b6a9eceab2
commit 26b0fc0bc5
3 changed files with 20 additions and 12 deletions

View File

@ -1,5 +1,5 @@
C Change\sthe\sname\sof\ssqlite3_atoi64\sback\sto\ssqlite3Atoi64\sso\sthat\sit\sis\sclearly\nand\sinternal\sAPI.\s\sModify\sthe\samalgamation\sto\suse\sa\smacro\sSQLITE_PRIVATE\ninstead\sof\sthe\skeyword\s"static"\sso\sthe\smacro\scan\sbe\soverridden\sto\sby\snothing.\s(CVS\s4124)
D 2007-06-26T00:37:28
C Modify\sthe\samalgamation\sgenerator\sto\sidentify\severy\sAPI\susing\sthe\nSQLITE_API\smacro\swhich\sis\snormally\sdefined\sto\snothing\sbut\swhich\scan\nbe\soverridden\son\sthe\scompiler\scommand-line\sto\sbe\s"static"\sif\sdesired.\nTicket\s#2453.\s(CVS\s4125)
D 2007-06-26T00:52:40
F Makefile.in 7f7485a4cc039476a42e534b3f26ec90e2f9753e
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -446,7 +446,7 @@ F tool/memleak2.awk 9cc20c8e8f3c675efac71ea0721ee6874a1566e8
F tool/memleak3.tcl 7707006ee908cffff210c98158788d85bb3fcdbf
F tool/mkkeywordhash.c fe15d1cbc61c2b0375634b6d8c1ef24520799ea0
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e x
F tool/mksqlite3c.tcl 3c062ba144060fdf9ac40f846570311dd75d70bf
F tool/mksqlite3c.tcl 5d8ed832629acd4f75d088dd0c647dc12c48b1b0
F tool/mksqlite3internalh.tcl 47737a925fb02fce43e2c0a14b3cc17574a4d44a
F tool/omittest.tcl e6b3d6a1285f9813bc1dea53bb522b4b72774710
F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c
@ -515,7 +515,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 5b3a490649ab88c168e3e5bf2efbc7f61b1b954d
R f6d478d470bd14098b1e348ce99c17b8
P 96190cf13dd7219f483308fea92d703328aac4c7
R 0a278f1a93b16895841922b584e0b14c
U drh
Z f364c8fcb2e6f1fc93356010ff2b7a3d
Z e9a004de1bf93d40a3ce2a532ab17bdd

View File

@ -1 +1 @@
96190cf13dd7219f483308fea92d703328aac4c7
474a52347d454ad499d7a78c88eb995c9d3254d1

View File

@ -74,6 +74,9 @@ if {$addstatic} {
puts $out \
{#ifndef SQLITE_PRIVATE
# define SQLITE_PRIVATE static
#endif
#ifndef SQLITE_API
# define SQLITE_API
#endif}
}
@ -127,9 +130,9 @@ proc copy_file {filename} {
section_comment "Begin file $tail"
set in [open $filename r]
if {[file extension $filename]==".h"} {
set declpattern {^ *[a-zA-Z][a-zA-Z_0-9 ]+ \*?sqlite3[A-Z][a-zA-Z0-9]+\(}
set declpattern {^ *[a-zA-Z][a-zA-Z_0-9 ]+ \*?(sqlite3[_A-Z][a-zA-Z0-9]+)\(}
} else {
set declpattern {^[a-zA-Z][a-zA-Z_0-9 ]+ \*?sqlite3[A-Z][a-zA-Z0-9]+\(}
set declpattern {^[a-zA-Z][a-zA-Z_0-9 ]+ \*?(sqlite3[_A-Z][a-zA-Z0-9]+)\(}
}
while {![eof $in]} {
set line [gets $in]
@ -151,10 +154,15 @@ proc copy_file {filename} {
puts $out "#if 0"
} elseif {[regexp {^#line} $line]} {
# Skip #line directives.
} elseif {$addstatic && [regexp $declpattern $line]
} elseif {$addstatic && [regexp $declpattern $line all funcname]
&& ![regexp {^static} $line]} {
# Add the "static" keyword before internal functions.
puts $out "SQLITE_PRIVATE $line"
# Add the SQLITE_PRIVATE or SQLITE_API keyword before functions.
# so that linkage can be modified at compile-time.
if {[regexp {^sqlite3_} $funcname]} {
puts $out "SQLITE_API $line"
} else {
puts $out "SQLITE_PRIVATE $line"
}
} else {
puts $out $line
}