Re: Building with Visual C++

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Building with Visual C++
Дата
Msg-id 6BCB9D8A16AC4241919521715F4D8BCEA352E3@algol.sollentuna.se
обсуждение исходный текст
Ответ на Building with Visual C++  ("Magnus Hagander" <mha@sollentuna.net>)
Список 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

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Additional current timestamp values
Следующее
От: "Magnus Hagander"
Дата:
Сообщение: Re: Building with Visual C++