From nacho.resa@gmail.com Tue Oct 20 07:26:50 2015 From: nacho.resa@gmail.com To: openldap-bugs@openldap.org Subject: Re: (ITS#8270) win32: fix conversion error Date: Tue, 20 Oct 2015 07:26:47 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2586384618635963701==" --===============2586384618635963701== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable --047d7bb03a5ac118d20522842ead Content-Type: text/plain; charset=3DUTF-8 So I took another closer look at this issue and I went for this possible solution: https://github.com/nice-software/lmdb/commit/03987789735141dc68ae8b2d0e5ad52d= 82cc80d0 Basically it errors out because MSVC needs stdcall on that method. Cheers. On Mon, Oct 19, 2015 at 2:55 PM, Ignacio Casal Quinteiro < nacho.resa(a)gmail.com> wrote: > Sorry! I did indeed meant to change just the windows part, for some reason > I thought it was already ifdeffed that part. > > https://github.com/nice-software/lmdb/commit/42577fe173923c1166f8382a53523a= 31479f9d43 > > This is the right patch. > > On Mon, Oct 19, 2015 at 1:43 PM, Hallvard Breien Furuseth < > h.b.furuseth(a)usit.uio.no> wrote: > >> On 19. okt. 2015 08:57, nacho.resa(a)gmail.com wrote: >> >>> I do not understand, I tested also with mingw64 (...) >>> >> >> There's no LPTHREAD_START_ROUTINE type on non-Windows machines. >> You could replace 'start' with '(LPTHREAD_START_ROUTINE)(start)' >> in the _WIN32 variant of '#define THREAD_CREATE...'. >> >> However, it's still wrong to call a function via another prototype. >> Maybe that'd fall on 32-bit Windows or something, I don't know >> how LPTHREAD_START_ROUTINE is defined. The safe way would be to >> give mdb_env_copythr() a prototype which does not need a cast. >> There is some code for that already. Maybe it can be improved. >> >> -- >> Hallvard >> > > > > -- > Ignacio Casal Quinteiro > --=20 Ignacio Casal Quinteiro --047d7bb03a5ac118d20522842ead Content-Type: text/html; charset=3DUTF-8 Content-Transfer-Encoding: quoted-printable
So I took another closer look at this issue and = =3D I went for this possible solution:
https://github=3D .com/nice-software/lmdb/commit/03987789735141dc68ae8b2d0e5ad52d82cc80d0=3D

Basically it errors out because MSVC needs stdcall on that me=3D thod.

Cheers.

On Mon, Oct 19, 2015 at 2:55 PM, Ignacio Casal Quinteiro= =3D <nacho.resa(a)gmail.com> wrote:
Sorry! I did indeed meant to change just the = =3D windows part, for some reason I thought it was already ifdeffed that part.<=3D br>https://github.com/nice-softwar= =3D e/lmdb/commit/42577fe173923c1166f8382a53523a31479f9d43

Thi=3D s is the right patch.

On Mon, Oct 19, 2015 at 1:43 PM, H= al=3D lvard Breien Furuseth <h.b.furuseth(a)usit.uio.no> wr= ot=3D e:
On 19. okt. 2015 08:57, nacho.resa(a)gmail.com wr= ote:=3D
I do not understand, I tested also with mingw64 (...)

There's no LPTHREAD_START_ROUTINE type on non-Windows machines.
You could replace 'start' with '(LPTHREAD_START_ROUTINE)(start)=3D '
in the _WIN32 variant of '#define THREAD_CREATE...'.

However, it's still wrong to call a function via another prototype.
Maybe that'd fall on 32-bit Windows or something, I don't know
how LPTHREAD_START_ROUTINE is defined.=3DC2=3DA0 The safe way would be to
give mdb_env_copythr() a prototype which does not need a cast.
There is some code for that already. Maybe it can be improved.

--
Hallvard



--
Ignacio Casal Quin= te=3D iro



--
Ignacio Casal Quinteiro
--047d7bb03a5ac118d20522842ead-- --===============2586384618635963701==--