Win32 püort of libpq

From: Edmund Mergl <E(dot)Mergl(at)bawue(dot)de>
To: PostgreSQL Hackers Mailing List <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Win32 püort of libpq
Date: 1999-09-30 05:24:34
Message-ID: 37F2F412.80ADD2D2@bawue.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

in the last few days I compiled libpq on Windows NT
using MS Visual Studio 6.0. I followed the instructions
given by Bob Kline <bkline(at)rksystems(dot)com> in his mail from
Fri, 3 Sep 1999.
Unfortuanetely he sent his mail only to dbi-users, so I would
like to repeat one major problem on this list.

Here is an excerpt from his mail:

4. The DllMain function in src/interfaces/libpq/libpqdll.c of the
PostgreSQL 6.5 sources, in which WSAStartup is invoked, is never called,
which causes gethostbyname calls to fail. Solution (more properly,
"kludge" -- I know there's a cleaner fix somewhere, but this works for
now): immediately after the local declarations for the connectDB function
in src/interfaces/libpq/fe-connect.c:

#ifdef WIN32
static int WeHaveCalledWSAStartup;

if (!WeHaveCalledWSAStartup) {
WSADATA wsaData;
if (WSAStartup(MAKEWORD(1, 1), &wsaData)) {
sprintf(conn->errorMessage,
"WSAStartup failed: errno=%d\n", h_errno);
goto connect_errReturn;
}
WeHaveCalledWSAStartup = 1;
}
#endif

Besides the effort to port the complete server om Win32
using the Cygnus environment, it would be nice to be able
to compile at least the client part (libpq) with a standard
MS-compiler.

So please apply this patch or an equivalent cleaner solution.

thanks
Edmund

--
Edmund Mergl
mailto:E(dot)Mergl(at)bawue(dot)de
http://www.bawue.de/~mergl

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 1999-09-30 05:53:43 Re: Non-beta RPMS for RedHat Linux -- PostgreSQL 6.5.2
Previous Message Don Baccus 1999-09-30 03:52:23 Re: [HACKERS] shared memory 651, freebsd 2.2.7