> Le 10 avr. 2017 à 11:11, dip <[email protected]> a écrit :
>
> I am mixing C and C++ code. My code is in C++, SQLite is in C.
> Just create memory.h:
>
> namespace Mem {
> // some functions
> }
>
> And create code.cpp:
>
> #include "memory.h"
> #include "sqlite3.h"
>
> void Func()
> {
> Mem::SomeFunc(); // gives the compilation error
> }
This is where I do:
#include "memory.h"
namespace sqlite
{
#include "sqlite3.h"
}
And the conflict with your Mem goes away for the price of qualifying your
references to SQLite symbols with 'sqlite::'. It fits me easily because we have
our own slim C++ wrapper around SQLite C API, so these prefixed references are
only slightly annoying (length of text) in the wrapper code. It might of course
not fit you and having sqlite3.h not exposing that Mem in the public namespace
is certainly the long term better solution for everyone.
--
Best Regards, Meilleures salutations, Met vriendelijke groeten,
Olivier Mascia, http://integral.software
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users