diff --git a/src/backend/libpq/ip.c b/src/backend/libpq/ip.c index 78a63728544bf839961877302ce279d28a5195f1..74bcda8eb1b64ceaf7abd9fa0323ce423cd581ba 100644 --- a/src/backend/libpq/ip.c +++ b/src/backend/libpq/ip.c @@ -8,7 +8,7 @@ * * * 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 @@ -20,8 +20,7 @@ /* 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> @@ -34,8 +33,7 @@ #endif #include <arpa/inet.h> #include <sys/file.h> -#endif /* !defined(_MSC_VER) && - * !defined(__BORLANDC__) */ +#endif #include "libpq/ip.h" diff --git a/src/backend/utils/mb/encnames.c b/src/backend/utils/mb/encnames.c index 634861a2053d17608c85d0eef92c8a9614fb8128..a3260fd61c4ff2de16afac0a354118338f63322d 100644 --- a/src/backend/utils/mb/encnames.c +++ b/src/backend/utils/mb/encnames.c @@ -2,7 +2,7 @@ * 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" @@ -13,7 +13,7 @@ #include "utils/builtins.h" #endif -#if !defined(_MSC_VER) && !defined(__BORLANDC__) +#ifndef WIN32_CLIENT_ONLY #include <unistd.h> #endif diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c index f434725269082e977bcc8f883727785dbcd9ebef..ede51f2f1368997de3d9a6eb3eb6830a5bccfee2 100644 --- a/src/bin/psql/print.c +++ b/src/bin/psql/print.c @@ -3,7 +3,7 @@ * * 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" @@ -12,7 +12,7 @@ #include <math.h> #include <signal.h> -#if !defined(_MSC_VER) && !defined(__BORLANDC__) +#ifndef WIN32_CLIENT_ONLY #include <unistd.h> #endif diff --git a/src/include/c.h b/src/include/c.h index fcdf6b404be782d991e0e29f73dc661680f9b599..861b11ce0d2e6a450aca2cf45fce37d7e46d2341 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -12,7 +12,7 @@ * 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 $ * *------------------------------------------------------------------------- */ @@ -54,6 +54,10 @@ #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" @@ -76,7 +80,7 @@ #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 diff --git a/src/include/getaddrinfo.h b/src/include/getaddrinfo.h index 893e7106c78ceb3684a3e61bc05f7d4cc1299639..f4bc4410ce599076a422b8e8cff99d276e79f235 100644 --- a/src/include/getaddrinfo.h +++ b/src/include/getaddrinfo.h @@ -15,14 +15,14 @@ * * 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 diff --git a/src/include/port.h b/src/include/port.h index 2c789fe4b3fe228455925684cde64b9be9fba32e..e60bc60f02d569911e3c5fff2a00f18d8570c01f 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -6,16 +6,17 @@ * 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 */ @@ -169,7 +170,7 @@ extern int pgunlink(const char *path); 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 @@ -183,7 +184,7 @@ extern bool rmtree(char *path, bool rmtopdir); #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__) @@ -242,7 +243,7 @@ extern double rint(double x); #endif #ifndef HAVE_INET_ATON -#if !defined(_MSC_VER) && !defined(__BORLANDC__) +#ifndef WIN32_CLIENT_ONLY #include <netinet/in.h> #include <arpa/inet.h> #endif diff --git a/src/include/port/win32.h b/src/include/port/win32.h index b2ebdd4e3ffc93557cb2ad87fc425d72492179c9..7c85043e70531b5918284d33f1a42361a985a3e1 100644 --- a/src/include/port/win32.h +++ b/src/include/port/win32.h @@ -1,4 +1,4 @@ -/* $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 @@ -31,7 +31,7 @@ #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) diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 212f7a63cd410c77ad35c48d1e8b8664f2394092..12022dc9dacb9494c3b50db24fdf42524114f2d9 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -23,7 +23,7 @@ * 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 $ * *------------------------------------------------------------------------- */ @@ -34,7 +34,7 @@ #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 diff --git a/src/port/getaddrinfo.c b/src/port/getaddrinfo.c index 906e1610807a0b2023a2e51d2b361c43f2e6c019..59da098f85a773fedecb8d9e81a3a3dca00c8236 100644 --- a/src/port/getaddrinfo.c +++ b/src/port/getaddrinfo.c @@ -12,7 +12,7 @@ * 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 $ * *------------------------------------------------------------------------- */ @@ -20,7 +20,7 @@ /* 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> diff --git a/src/port/inet_aton.c b/src/port/inet_aton.c index 9b099cc549b584811e8d4540252d7e57fa21c05f..521e61dcf99842883a5e20dd2af939261334b2ef 100644 --- a/src/port/inet_aton.c +++ b/src/port/inet_aton.c @@ -1,4 +1,4 @@ -/* $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 @@ -44,7 +44,7 @@ #include "c.h" -#if !defined(_MSC_VER) && !defined(__BORLANDC__) +#ifndef WIN32_CLIENT_ONLY #include <netinet/in.h> #include <ctype.h> #endif diff --git a/src/port/thread.c b/src/port/thread.c index 96610f9f5a0c72b7e67a9c593366795ba64d5a4b..f950e419a141d44a5e6a40dbfafdd26b1e8cbcd6 100644 --- a/src/port/thread.c +++ b/src/port/thread.c @@ -7,7 +7,7 @@ * * 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 $ * *------------------------------------------------------------------------- */ @@ -16,7 +16,7 @@ #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>