mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Hello!
Here are two new patches for the Win32 support. 1) The patch based on the one from Hiroshi Inoue [Inoue@tpf.co.jp], to load Winsock.dll from libpq.dll. 2) A patch for psql.c to remove the call to WSAStartup(), since it is not required when it's done in libpq.dll. I'm still looking for the possibility of having a crypt() function in libpq.dll too, the same way getopt was included. Any chance of getting this before 6.4, or should we wait for the next one? //Magnus
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.84 1998/10/07 22:31:50 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.85 1998/10/08 00:10:46 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -558,7 +558,6 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
|
|||||||
vacrelstats->num_tuples, vacrelstats->hasindex, vacrelstats);
|
vacrelstats->num_tuples, vacrelstats->hasindex, vacrelstats);
|
||||||
|
|
||||||
/* next command frees attribute stats */
|
/* next command frees attribute stats */
|
||||||
|
|
||||||
CommitTransactionCommand();
|
CommitTransactionCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.161 1998/09/21 02:25:23 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.162 1998/10/08 00:10:47 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -2724,18 +2724,6 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
char *home = NULL; /* Used to store $HOME */
|
char *home = NULL; /* Used to store $HOME */
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
{
|
|
||||||
WSADATA wsaData;
|
|
||||||
|
|
||||||
if (WSAStartup(MAKEWORD(1, 1), &wsaData))
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Failed to start winsock: %i\n", WSAGetLastError());
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MemSet(&settings, 0, sizeof settings);
|
MemSet(&settings, 0, sizeof settings);
|
||||||
settings.opt.align = 1;
|
settings.opt.align = 1;
|
||||||
settings.opt.header = 1;
|
settings.opt.header = 1;
|
||||||
|
@ -1,8 +1,25 @@
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <winsock.h>
|
||||||
|
|
||||||
BOOL WINAPI
|
BOOL WINAPI
|
||||||
DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
|
DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
|
||||||
LPVOID lpReserved)
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user