summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2004-04-05 03:16:21 +0000
committerBruce Momjian <bruce@momjian.us>2004-04-05 03:16:21 +0000
commit422d4819ee7c735cc5c122d872aa9b4e89780eae (patch)
treef4099fff4178de1480eef2d18ce23e16fb13f994 /src/include
parent823ac7c2b4e610b11dd797c93e0438ba5f7949ed (diff)
Corrects issues recently posted by Dann Corbit, allowing libpq/psql to
be built under VC++. Moves a pgstat win32 #def to port.h Claudio Natoli
Diffstat (limited to 'src/include')
-rw-r--r--src/include/libpq/libpq-be.h4
-rw-r--r--src/include/port.h21
2 files changed, 21 insertions, 4 deletions
diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h
index 3200042dae0..718001c9b3a 100644
--- a/src/include/libpq/libpq-be.h
+++ b/src/include/libpq/libpq-be.h
@@ -11,14 +11,16 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.43 2004/03/19 02:23:59 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.44 2004/04/05 03:16:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef LIBPQ_BE_H
#define LIBPQ_BE_H
+#ifndef _MSC_VER
#include <sys/time.h>
+#endif
#ifdef USE_SSL
#include <openssl/ssl.h>
#include <openssl/err.h>
diff --git a/src/include/port.h b/src/include/port.h
index 70f2b5f3fe5..e539d1f25db 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/port.h,v 1.23 2004/03/24 03:54:16 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.24 2004/04/05 03:16:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -38,13 +38,26 @@ extern int fseeko(FILE *stream, off_t offset, int whence);
extern off_t ftello(FILE *stream);
#endif
-#if defined(WIN32) || defined(__CYGWIN__)
+/*
+ * WIN32 doesn't allow descriptors returned by pipe() to be used in select(),
+ * so for that platform we use socket() instead of pipe().
+ */
+#ifndef WIN32
+#define pgpipe(a) pipe(a)
+#define piperead(a,b,c) read(a,b,c)
+#define pipewrite(a,b,c) write(a,b,c)
+#else
+extern int pgpipe(int handles[2]);
+#define piperead(a,b,c) recv(a,b,c,0)
+#define pipewrite(a,b,c) send(a,b,c,0)
+#endif
+
+#if defined(__MINGW32__) || defined(__CYGWIN__)
/*
* Win32 doesn't have reliable rename/unlink during concurrent access
*/
extern int pgrename(const char *from, const char *to);
extern int pgunlink(const char *path);
-
#define rename(from, to) pgrename(from, to)
#define unlink(path) pgunlink(path)
#endif
@@ -52,8 +65,10 @@ extern int pgunlink(const char *path);
#ifdef WIN32
/* open() replacement to allow delete of held files */
+#ifndef _MSC_VER
extern int win32_open(const char*,int,...);
#define open(a,b,...) win32_open(a,b,##__VA_ARGS__)
+#endif
extern int copydir(char *fromdir, char *todir);