From 9b3d66ecbd2656c79825569bceecceb42ef45d73 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 20 Aug 2000 10:55:35 +0000 Subject: Introduce HAVE_UNIX_SOCKETS symbol to replace repeatedly listing all the unsupported platforms. --- src/bin/psql/prompt.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/bin/psql/prompt.c') diff --git a/src/bin/psql/prompt.c b/src/bin/psql/prompt.c index 9901b21652b..1177c6f3f33 100644 --- a/src/bin/psql/prompt.c +++ b/src/bin/psql/prompt.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/prompt.c,v 1.12 2000/04/12 17:16:23 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/prompt.c,v 1.13 2000/08/20 10:55:34 petere Exp $ */ #include "postgres.h" #include "prompt.h" @@ -19,9 +19,9 @@ #include #endif -#if !defined(WIN32) && !defined(__CYGWIN32__) && !defined(__QNX__) -#include -#include +#ifdef HAVE_UNIX_SOCKETS +# include +# include #endif /*-------------------------- @@ -64,7 +64,7 @@ /* * We need hostname information, only if connection is via UNIX socket */ -#if !defined(WIN32) && !defined(__CYGWIN32__) && !defined(__QNX__) +#ifdef HAVE_UNIX_SOCKETS #define DOMAINNAME 1 #define HOSTNAME 2 @@ -104,7 +104,8 @@ localhost(int type, char *buf, int siz) return buf; } -#endif +#endif /* HAVE_UNIX_SOCKETS */ + char * get_prompt(promptStatus_t status) @@ -173,7 +174,7 @@ get_prompt(promptStatus_t status) buf[strcspn(buf, ".")] = '\0'; } /* UNIX socket */ -#if !defined(WIN32) && !defined(__CYGWIN32__) && !defined(__QNX__) +#ifdef HAVE_UNIX_SOCKETS else { if (*p == 'm') @@ -181,7 +182,7 @@ get_prompt(promptStatus_t status) else localhost(DOMAINNAME, buf, MAX_PROMPT_SIZE); } -#endif +#endif /* HAVE_UNIX_SOCKETS */ } break; /* DB server port number */ -- cgit v1.2.3