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 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.31 2002/09/01 23:30:46 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.32 2002/10/03 17:09:42 momjian Exp $
*/
#include "postgres_fe.h"
#include "print.h"
@ -282,7 +282,7 @@ print_aligned_text(const char *title, const char *const * headers,
{
int tlen;
if ((tlen = pg_wcswidth((unsigned char *) title, strlen(title))) >= total_w)
if ((unsigned int) (tlen = pg_wcswidth((unsigned char *) title, strlen(title))) >= total_w)
fprintf(fout, "%s\n", title);
else
fprintf(fout, "%-*s%s\n", (int) (total_w - tlen) / 2, "", title);
@ -1184,8 +1184,8 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout)
footers ? (const char *const *) footers : (const char *const *) (opt->footers),
align, &opt->topt, fout);
free(headers);
free(cells);
free((void *) headers);
free((void *) cells);
if (footers)
{
free(footers[0]);