Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-10 Thread Daniel Anderson
ok, but then namespace ns1 { extern "C" int ert(void) { return 9; } }; namespace ns2 { extern "C" int ert(void); }; are both the same function ! it would be simpler in the sqlite case to define Mem to something else before include, and then undef it instead of playing with namespace 2017-04-1

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-10 Thread Olivier Mascia
> Le 10 avr. 2017 à 16:21, Daniel Anderson a écrit : > > as Sqlite is already within extern "C" > > I'm wondering how your namespace trick can work ? Both are simply unrelated. extern "C" is a linkage specification. Not a namespace declaration. -- Best Regards, Meilleures salutations, Met vr

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-10 Thread Daniel Anderson
as Sqlite is already within extern "C" I'm wondering how your namespace trick can work ? 2017-04-10 9:41 GMT-04:00 Bob Friesenhahn : > On Mon, 10 Apr 2017, Olivier Mascia wrote: > >> >> This is where I do: >> >> #include "memory.h" >> namespace sqlite >> { >> #include "sqlite3.h" >> } >> >> An

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-10 Thread Bob Friesenhahn
On Mon, 10 Apr 2017, Olivier Mascia wrote: 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

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-10 Thread Olivier Mascia
> Le 10 avr. 2017 à 11:11, dip 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(); // giv

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-10 Thread Daniel Anderson
create code.cpp: > > #include "memory.h" > #include "sqlite3.h" > > void Func() > { > Mem::SomeFunc(); // gives the compilation error > } > > Sent with [ProtonMail](https://protonmail.com) Secure Email. > > ---- Original Message -------- >

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-10 Thread dip
tps://protonmail.com) Secure Email. Original Message ---- Subject: Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name Local Time: April 10, 2017 2:29 AM UTC Time: April 9, 2017 11:29 PM From: woni...@gmail.com To: SQLite mailing list I see no p

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-09 Thread Daniel Anderson
](https://protonmail.com) Secure Email. > > -------- Original Message ---- > Subject: Re: [sqlite] "struct Mem" conflicts with namespaces/classes > having the same name > Local Time: April 9, 2017 10:23 PM > UTC Time: April 9, 2017 7:23 PM > From: d3c...@gmail.com >

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-09 Thread Bob Friesenhahn
On Sun, 9 Apr 2017, dip wrote: What happens with mangling then? extern "C" functions inside a namespace just do not get mangled? If so, sounds like a workaround. Yes, extern "C" functions don't get mangled. Bob -- Bob Friesenhahn bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/use

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-09 Thread Keith Medcalf
, 2017 14:48 > To: SQLite mailing list > Subject: Re: [sqlite] "struct Mem" conflicts with namespaces/classes > having the same name > > What happens with mangling then? extern "C" functions inside a namespace > just do not get mangled? If so, sounds like a worka

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-09 Thread dip
tonmail.com) Secure Email. Original Message ---- Subject: Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name Local Time: April 9, 2017 11:19 PM UTC Time: April 9, 2017 8:19 PM From: bfrie...@simple.dallas.tx.us To: SQLite mailing list On Sun, 9 Apr 2017, dip wr

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-09 Thread Bob Friesenhahn
On Sun, 9 Apr 2017, dip wrote: sqlite3.c is C file. C does not support namespaces. Even though another project files are .cpp, sqlite3.c is still compiled as C language source. Therefore, no ability to use "using namespace" in sqlite3.c. Also, "using namespace" does not actually put functions i

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-09 Thread dip
ce in namespace. It just helps it find another functions without specifying namespace name. Sent with [ProtonMail](https://protonmail.com) Secure Email. Original Message ---- Subject: Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name Local Ti

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-09 Thread J Decker
On Sun, Apr 9, 2017 at 12:20 PM, Richard Damon wrote: > On 4/9/17 1:49 PM, Olivier Mascia wrote: > >> Le 9 avr. 2017 à 18:49, dip a écrit : >>> >>> I downloaded latest SQLite Amalgamation (v 3.18.0) to embed it in my >>> project. >>> After that I got a lot of errors while compiling (compiler is

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-09 Thread Richard Damon
On 4/9/17 1:49 PM, Olivier Mascia wrote: Le 9 avr. 2017 à 18:49, dip a écrit : I downloaded latest SQLite Amalgamation (v 3.18.0) to embed it in my project. After that I got a lot of errors while compiling (compiler is Microsoft Visual Studio 2017). Errors were caused by the following line in

Re: [sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-09 Thread Olivier Mascia
> Le 9 avr. 2017 à 18:49, dip a écrit : > > I downloaded latest SQLite Amalgamation (v 3.18.0) to embed it in my project. > After that I got a lot of errors while compiling (compiler is Microsoft > Visual Studio 2017). > Errors were caused by the following line in sqlite3.h: > > typedef struct

[sqlite] "struct Mem" conflicts with namespaces/classes having the same name

2017-04-09 Thread dip
I downloaded latest SQLite Amalgamation (v 3.18.0) to embed it in my project. After that I got a lot of errors while compiling (compiler is Microsoft Visual Studio 2017). Errors were caused by the following line in sqlite3.h: typedef struct Mem sqlite3_value; The reason is that I have the namesp