1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

> Ok, where's a "system dependent hack" :)

> It seems that win9x doesn't have the "netmsg.dll" so it defaults to "normal"
> FormatMessage.
> I wonder if one could load wsock32.dll or winsock.dll on those systems
> instead of netmsg.dll.
>
> Mikhail, could you please test this code on your nt4 system?
> Could someone else test this code on a win98/95 system?
>
> It works on win2k over here.

It works on win2k here too but not on win98/95 or winNT.
Anyway, attached is the patch which uses Magnus's my_sock_strerror
function (renamed to winsock_strerror). The only difference is that
I put the code to load and unload netmsg.dll in the libpqdll.c
(is this OK Magnus?).

Mikhail Terekhov
This commit is contained in:
Bruce Momjian
2001-08-21 20:39:54 +00:00
parent f933766ba7
commit 5db5c2db61
7 changed files with 90 additions and 60 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: libpq-fe.h,v 1.71 2001/03/22 04:01:27 momjian Exp $
* $Id: libpq-fe.h,v 1.72 2001/08/21 20:39:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -21,10 +21,21 @@ extern "C"
#endif
#include <stdio.h>
#ifdef WIN32
#define SOCK_ERRNO (WSAGetLastError ())
#define SOCK_STRERROR winsock_strerror
#else
#define SOCK_ERRNO errno
#define SOCK_STRERROR strerror
#endif
/* postgres_ext.h defines the backend's externally visible types,
* such as Oid.
*/
#include "postgres_ext.h"
#ifdef USE_SSL
#include <openssl/ssl.h>
#endif