From c765b4b052262416a2212ba206d9669f88ca68b9 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 3 Jul 1998 04:24:16 +0000 Subject: Hello! Through some minor changes, I have been able to compile the libpq client libraries on the Win32 platform. Since the libpq communications part has been rewritten, this has become much easier. Enclosed is a patch that will allow at least Microsoft Visual C++ to compile libpq into both a static and a dynamic library. I will take a look at porting the psql frontend as well, but I figured it was a good idea to send in these patches first - so no major changes are done to the files before it gets applied (if it does). Regards, Magnus Hagander --- src/interfaces/libpq/fe-misc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/interfaces/libpq/fe-misc.c') diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index e79460798d9..52bf28b6123 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -24,7 +24,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.15 1998/06/15 19:30:26 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.16 1998/07/03 04:24:14 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -34,10 +34,14 @@ #include #include #include +#ifdef WIN32 +#include "win32.h" +#else #include #if !defined(NO_UNISTD_H) #include #endif +#endif /* WIN32 */ #include /* for fd_set stuff */ #ifdef HAVE_SYS_SELECT_H #include @@ -412,7 +416,11 @@ tryAgain2: " before or while processing the request.\n"); conn->status = CONNECTION_BAD; /* No more connection to * backend */ +#ifdef WIN32 + closesocket(conn->sock); +#else close(conn->sock); +#endif conn->sock = -1; return -1; -- cgit v1.2.3