Re: Building with Visual C++

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Building with Visual C++
Date: 2006-04-24 07:38:10
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA352E3@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

> > I've been working on getting the full backend to compile
> and run using
> > Visual C++ instead of mingw/gcc, and have made some good progress.
> >
>
> This is great!

Thanks.

> > *) Add s_lock implementation based on InterlockedCompareExchange
> > instead of assembly code (gcc style asm not supported, and
> this should
> > probably be about as fast from what I hear)
>
> _InterlockedCompareExchange is even better IMHO ...

I could've sworn the non-_ was #defined to the other one, but
double-checkign that I see that's only done on 64-bit systems. Will
update.

> > src/port/dirent.c - opendir/readdir/closedir implementation
> for win32,
> > that doesn't even have the bugs mingw had in it ;)
>
> But seems it has a typo ;-) Check out this line:
>
> errno = GetLastError();

Argh. That was one point where I was lazy.

The solution to that is of course to use _dosmaperr(). The problem is
that _dosmaperr is in backend/port/error.c, but dirent is needed both in
frontend and backend.
To fix this, I suggest we move _dosmaperr() into src/port instead.
Probably renaming the file to win32error.c in the process. (The other
way would be to explicitly reference that file from the utils that need
dirent, but that just seems way ugly)
Thoughts?

//Magnus

Browse pgsql-patches by date

  From Date Subject
Next Message Magnus Hagander 2006-04-24 07:40:23 Re: Building with Visual C++
Previous Message Bruce Momjian 2006-04-24 02:58:31 Re: Additional current timestamp values