*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.28 2004/08/29 05:06:43 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.29 2004/09/27 23:24:30 momjian Exp $
*
* This file and the IPV6 implementation were initially provided by
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
/* This is intended to be used in both frontend and backend, so use c.h */
#include "c.h"
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
-
+#ifndef WIN32_CLIENT_ONLY
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#endif
#include <arpa/inet.h>
#include <sys/file.h>
-#endif /* !defined(_MSC_VER) &&
- * !defined(__BORLANDC__) */
+#endif
#include "libpq/ip.h"
* Encoding names and routines for work with it. All
* in this file is shared bedween FE and BE.
*
- * $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.19 2004/09/17 21:59:57 petere Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.20 2004/09/27 23:24:33 momjian Exp $
*/
#ifdef FRONTEND
#include "postgres_fe.h"
#include "utils/builtins.h"
#endif
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+#ifndef WIN32_CLIENT_ONLY
#include <unistd.h>
#endif
*
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.51 2004/08/29 05:06:54 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.52 2004/09/27 23:24:35 momjian Exp $
*/
#include "postgres_fe.h"
#include "common.h"
#include <math.h>
#include <signal.h>
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+#ifndef WIN32_CLIENT_ONLY
#include <unistd.h>
#endif
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/c.h,v 1.176 2004/09/27 22:11:22 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/c.h,v 1.177 2004/09/27 23:24:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "pg_config_manual.h" /* must be after pg_config.h */
#if !defined(WIN32) && !defined(__CYGWIN__)
#include "pg_config_os.h" /* must be before any system header files */
+#else
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+#define WIN32_CLIENT_ONLY
+#endif
#endif
#include "postgres_ext.h"
#endif
#if defined(WIN32) || defined(__CYGWIN__)
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+#ifndef WIN32_CLIENT_ONLY
/* We have to redefine some system functions after they are included above */
#include "pg_config_os.h"
#else
*
* Copyright (c) 2003, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/getaddrinfo.h,v 1.12 2003/11/29 22:40:53 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/getaddrinfo.h,v 1.13 2004/09/27 23:24:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef GETADDRINFO_H
#define GETADDRINFO_H
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+#ifndef WIN32_CLIENT_ONLY
#include <sys/socket.h>
#include <netdb.h>
#endif
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/port.h,v 1.62 2004/09/27 20:37:20 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.63 2004/09/27 23:24:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+#ifndef WIN32_CLIENT_ONLY
/* for thread.c */
#include <pwd.h>
#include <netdb.h>
#endif
+
#include <ctype.h>
/* non-blocking */
extern int pgsymlink(const char *oldpath, const char *newpath);
/* Include this first so later includes don't see these defines */
-#ifdef _MSC_VER
+#ifdef WIN32_CLIENT_ONLY
#include <io.h>
#endif
#ifdef WIN32
/* open() replacement to allow delete of held files */
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+#ifndef WIN32_CLIENT_ONLY
extern int win32_open(const char *, int,...);
#define open(a,b,...) win32_open(a,b,##__VA_ARGS__)
#endif
#ifndef HAVE_INET_ATON
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+#ifndef WIN32_CLIENT_ONLY
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
-/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.33 2004/09/14 03:50:17 tgl Exp $ */
+/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.34 2004/09/27 23:24:40 momjian Exp $ */
/* undefine and redefine after #include */
#undef mkdir
#define DLLIMPORT __declspec (dllimport)
#endif
-#elif defined(WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__)) /* not CYGWIN or MingW */
+#elif defined(WIN32_CLIENT_ONLY)
#if defined(_DLL)
#define DLLIMPORT __declspec (dllexport)
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.110 2004/08/29 05:07:00 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.111 2004/09/27 23:24:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <signal.h>
#include <time.h>
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+#ifndef WIN32_CLIENT_ONLY
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/getaddrinfo.c,v 1.12 2003/11/29 19:52:13 pgsql Exp $
+ * $PostgreSQL: pgsql/src/port/getaddrinfo.c,v 1.13 2004/09/27 23:24:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* This is intended to be used in both frontend and backend, so use c.h */
#include "c.h"
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+#ifndef WIN32_CLIENT_ONLY
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
-/* $PostgreSQL: pgsql/src/port/inet_aton.c,v 1.6 2003/11/29 22:41:31 pgsql Exp $
+/* $PostgreSQL: pgsql/src/port/inet_aton.c,v 1.7 2004/09/27 23:24:45 momjian Exp $
*
* This inet_aton() function was taken from the GNU C library and
* incorporated into Postgres for those systems which do not have this
#include "c.h"
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+#ifndef WIN32_CLIENT_ONLY
#include <netinet/in.h>
#include <ctype.h>
#endif
*
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/port/thread.c,v 1.25 2004/08/29 05:07:02 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/thread.c,v 1.26 2004/09/27 23:24:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <sys/types.h>
#include <errno.h>
-#if defined(WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__))
+#ifdef WIN32_CLIENT_ONLY
#undef ERROR
#else
#include <pwd.h>