SQLite

Check-in [474a52347d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 474a52347d454ad499d7a78c88eb995c9d3254d1
User & Date: drh 2007-06-26 00:52:40.000
Context
2007-06-26
01:04
Try to work around an MSVC compiler bug. Ticket #2457. (CVS 4126) (check-in: 4a7079a19a user: drh tags: trunk)
00:52
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) (check-in: 474a52347d user: drh tags: trunk)
00:37
Change the name of sqlite3_atoi64 back to sqlite3Atoi64 so that it is clearly and internal API. Modify the amalgamation to use a macro SQLITE_PRIVATE instead of the keyword "static" so the macro can be overridden to by nothing. (CVS 4124) (check-in: 96190cf13d user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to tool/mksqlite3c.tcl.
70
71
72
73
74
75
76



77
78
79
80
81
82
83
** This amalgamation was generated on $today.
*/
#define SQLITE_AMALGAMATION 1}]
if {$addstatic} {
  puts $out \
{#ifndef SQLITE_PRIVATE
# define SQLITE_PRIVATE static



#endif}
}

# 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.
#







>
>
>







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
** This amalgamation was generated on $today.
*/
#define SQLITE_AMALGAMATION 1}]
if {$addstatic} {
  puts $out \
{#ifndef SQLITE_PRIVATE
# define SQLITE_PRIVATE static
#endif
#ifndef SQLITE_API
# define SQLITE_API
#endif}
}

# 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.
#
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#
proc copy_file {filename} {
  global seen_hdr available_hdr out addstatic
  set tail [file tail $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]+\(}
  } else {
    set declpattern {^[a-zA-Z][a-zA-Z_0-9 ]+ \*?sqlite3[A-Z][a-zA-Z0-9]+\(}
  }
  while {![eof $in]} {
    set line [gets $in]
    if {[regexp {^#\s*include\s+["<]([^">]+)[">]} $line all hdr]} {
      if {[info exists available_hdr($hdr)]} {
        if {$available_hdr($hdr)} {
          if {$hdr!="os_common.h"} {







|

|







126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#
proc copy_file {filename} {
  global seen_hdr available_hdr out addstatic
  set tail [file tail $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]+)\(}
  } else {
    set declpattern {^[a-zA-Z][a-zA-Z_0-9 ]+ \*?(sqlite3[_A-Z][a-zA-Z0-9]+)\(}
  }
  while {![eof $in]} {
    set line [gets $in]
    if {[regexp {^#\s*include\s+["<]([^">]+)[">]} $line all hdr]} {
      if {[info exists available_hdr($hdr)]} {
        if {$available_hdr($hdr)} {
          if {$hdr!="os_common.h"} {
147
148
149
150
151
152
153
154
155
156




157

158
159
160
161
162
163
164
        set seen_hdr($hdr) 1
        puts $out $line
      }
    } elseif {[regexp {^#ifdef __cplusplus} $line]} {
      puts $out "#if 0"
    } elseif {[regexp {^#line} $line]} {
      # Skip #line directives.
    } elseif {$addstatic && [regexp $declpattern $line] 
                  && ![regexp {^static} $line]} {
      # Add the "static" keyword before internal functions.




      puts $out "SQLITE_PRIVATE $line"

    } else {
      puts $out $line
    }
  }
  close $in
  section_comment "End of $tail"
}







|

|
>
>
>
>
|
>







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
        set seen_hdr($hdr) 1
        puts $out $line
      }
    } elseif {[regexp {^#ifdef __cplusplus} $line]} {
      puts $out "#if 0"
    } elseif {[regexp {^#line} $line]} {
      # Skip #line directives.
    } elseif {$addstatic && [regexp $declpattern $line all funcname] 
                  && ![regexp {^static} $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
    }
  }
  close $in
  section_comment "End of $tail"
}