1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

The attached patch fixes a number of issues related to compiling the

client
utilities (libpq.dll and psql.exe) for win32 (missing defines,
adjustments to
includes, pedantic casting, non-existent functions) per:
   http://developer.postgresql.org/docs/postgres/install-win32.html.

It compiles cleanly under Windows 2000 using Visual Studio .net. Also
compiles clean and passes all regression tests (regular and contrib)
under Linux.

In addition to a review by the usual suspects, it would be very
desirable for  someone well versed in the peculiarities of win32 to take
a look.

Joe Conway
This commit is contained in:
Bruce Momjian
2002-10-03 17:09:42 +00:00
parent d4eae72513
commit a0bf2503ea
16 changed files with 94 additions and 64 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.81 2002/09/22 20:57:21 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.82 2002/10/03 17:09:41 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
@ -23,6 +23,7 @@
#include <win32.h>
#include <io.h>
#include <fcntl.h>
#include <direct.h>
#endif
#include "libpq-fe.h"
@ -1163,7 +1164,7 @@ scan_option(char **string, enum option_type type, char *quote, bool semicolon)
return NULL;
}
if (i < token_len - 1)
if (i < (int) token_len - 1)
return_val[i + 1] = '\0';
}
@ -1240,7 +1241,7 @@ unescape(const unsigned char *source, size_t len)
exit(EXIT_FAILURE);
}
for (p = source; p - source < len && *p; p += PQmblen(p, pset.encoding))
for (p = source; p - source < (int) len && *p; p += PQmblen(p, pset.encoding))
{
if (esc)
{
@ -1278,7 +1279,7 @@ unescape(const unsigned char *source, size_t len)
char *end;
l = strtol(p, &end, 0);
c = l;
c = (char) l;
p = end - 1;
break;
}