-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [I am the author of APSW]
On 24/03/12 14:22, Larry Brasfield wrote: > Except for its clever hiding of SQLite's C API names (via "#define > SQLITE_API static"), There is nothing "clever" about it - SQLite exposes various things like that so compilation can be controlled. Examples are calling convention and visibility. > there is no particular reason that apsw.c needed to expose so many > different name sources to each other. Believe it or not, I am not insane. APSW actually supports static including of the amalgamation, and static and dynamic linking. Static amalgamation has two major benefits. The first is performance - because everything is a single translation unit the compiler does a lot of inlining. The last time I measured the benefit a few years back it was around 10% compared to static linking. The second has to do with visibility of symbols. When doing the static amalgamation exactly one symbol is visible - the shared library entry point for the Python extension. On some platforms, Mac especially, there will be other copies of SQLite loaded into the process. (Mac is especially evil and will override your directions and use system SQLite no matter what.) If your shared library exposes any SQLite related symbols which could happen with static or dynamic linking then it is a crapshot as to how all the pieces of code using SQLite interact with the various SQLite's available. Consequently the single best thing to do is include the SQLite amalgamation statically as it is far more robust. > Well, you can inject a -DWINDOWS_LEAN_AND_MEAN into the compiler > invocation for just that source, avoiding the need to modify its text. Or I'll just modify APSW for the next release. The issue actually only happens for some combinations of the Microsoft dev tools and sdks. It doesn't happen on the combination I use. (Use is also constrained for binary compatibility reasons.) >> A shame to have to deal with this bad behavior from Windows.h... Indeed. Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk9ufuMACgkQmOOfHg372QQqPgCgw4v34zTMekWkBZXeppBXh7C0 giwAn1qsgP/84ZnJs4Fh9QGZ747nTiva =rm1f -----END PGP SIGNATURE----- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users