mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-10 19:29:30 +02:00
. So i took the opportunity to fix some stuff: 1. Made the thing compile (typos & needed definitions) with the new pqsecure_* s tuff, and added fe-secure.c to the win32.mak makefile. 2. Fixed some MULTIBYTE compile errors (when building without MB support). 3. Made it do that you can build with debug info: "nmake -f win32.mak DEBUG=1". 4. Misc small compiler speedup changes. The resulting .dll has been tested in production, and everything seems ok. I CC:ed -hackers because i'm not sure about two things: 1. In libpq-int.h I typedef ssize_t as an int because Visual C (v6.0) doesn't de fine ssize_t. Is that ok, or is there any standard about what type should be use d for ssize_t? 2. To keep the .dll api consistent regarding MULTIBYTE I just return -1 in fe-connect.c:PQsetClientEncoding() instead of taking away the whole function. I wonder if i should do any compares with the conn->client_encoding and return 0 if not hing would have changed (if so how do i check that?). Regards Magnus Naeslund
32 lines
513 B
C
32 lines
513 B
C
#define WIN32_LEAN_AND_MEAN
|
|
#include <winsock.h>
|
|
#include <windows.h>
|
|
#include "win32.h"
|
|
|
|
|
|
BOOL WINAPI
|
|
DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
|
|
LPVOID lpReserved)
|
|
{
|
|
WSADATA wsaData;
|
|
|
|
switch (fdwReason)
|
|
{
|
|
case DLL_PROCESS_ATTACH:
|
|
if (WSAStartup(MAKEWORD(1, 1), &wsaData))
|
|
{
|
|
/*
|
|
* No really good way to do error handling here, since we
|
|
* don't know how we were loaded
|
|
*/
|
|
return FALSE;
|
|
}
|
|
break;
|
|
case DLL_PROCESS_DETACH:
|
|
WSACleanup();
|
|
break;
|
|
}
|
|
|
|
return TRUE;
|
|
}
|