summaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-10-03 17:09:42 +0000
committerBruce Momjian <bruce@momjian.us>2002-10-03 17:09:42 +0000
commita0bf2503ea0d9a1a2208dd3cf74727bcda7e69d2 (patch)
treeaa3d6727dc94d4a0c4741077184e7cfcf5cdf709 /src/bin/psql/command.c
parentd4eae72513d919522c8711b55894511f4fb49443 (diff)
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
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 32a94bad7f6..a9477c68ed9 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -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;
}