-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/28/2014 08:18 PM, Ward Willats wrote:
> I am using the amalgamation in a C++ library statically linked into
> other people's applications.
> 
> Is there a way to namespace and/or macro and/or let C++ do its
> name-mangling thing to all the identifiers (by running the CPP
> compiler and turning __cplusplus off) so only my library
> translation units can use this "secret" version? (Or, more like, so
> the host app doesn't accidentally use my version.)

I have another approach to this that works well.  All of my code that
interacts with SQLite is in one file.  At the top of the file I do this:

  #define SQLITE_API static
  #define SQLITE_EXTERN static
  #include "sqlite3.c"

The rest of the file references the sqlite3 api as normal.  None of
the symbols leak, and it is a little faster as the compiler can inline
static methods.

Roger


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlRRB0UACgkQmOOfHg372QSELQCgoWKxiyy2RHbmZr5VKAjal/jf
3iwAoK+B9xnnME9Jg+08XIt7PB+rYrl/
=Gwsy
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to