Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group