Added consistent include file handling for MAXHOSTNAMELEN.

If I have introduced any syntax errors with this, I will patch them in
the morning, and Marc will have a good laugh.
This commit is contained in:
Bruce Momjian 1996-10-13 04:50:27 +00:00
parent abb1b3e770
commit 86be8677a9
5 changed files with 25 additions and 31 deletions

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.3 1996/10/12 07:47:08 bryanh Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.4 1996/10/13 04:49:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -52,7 +52,10 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <sys/param.h> /* for MAX{HOSTNAME,PATH}LEN, NOFILE */ #include <sys/param.h> /* for MAXHOSTNAMELEN on most */
#ifndef MAXHOSTNAMELEN
#include <netdb.h> /* for MAXHOSTNAMELEN on some */
#endif
#include <pwd.h> #include <pwd.h>
#include <ctype.h> /* isspace() declaration */ #include <ctype.h> /* isspace() declaration */

View File

@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.13 1996/10/13 04:01:05 bryanh Exp $ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.14 1996/10/13 04:49:48 momjian Exp $
* *
* NOTES * NOTES
* *
@ -47,25 +47,16 @@
#include <sys/stat.h> /* for umask */ #include <sys/stat.h> /* for umask */
#include <sys/time.h> #include <sys/time.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN on most */ #include <sys/param.h> /* for MAXHOSTNAMELEN on most */
#ifndef MAXHOSTNAMELEN
#if defined(USES_WINSOCK) #include <netdb.h> /* for MAXHOSTNAMELEN on some */
# include <winsock.h> #endif
# include <limits.h> #if defined(USE_LIMITS_H)
# define MAXINT INT_MAX # include <machine/limits.h>
# define MAXINT INT_MAX
#else #else
# include <netdb.h> /* for MAXHOSTNAMELEN on some */ # include <values.h>
# ifndef MAXHOSTNAMELEN /* for MAXHOSTNAMELEN everywhere else */ #endif /* !USE_LIMITS_H */
# include <arpa/nameser.h> #include <sys/wait.h>
# define MAXHOSTNAMELEN MAXDNAME
# endif
# if defined(USE_LIMITS_H)
# include <machine/limits.h>
# define MAXINT INT_MAX
# else
# include <values.h>
# endif /* !USE_LIMITS_H */
# include <sys/wait.h>
#endif /* USES_WINSOCK */
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.9 1996/10/04 20:16:32 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.10 1996/10/13 04:49:57 momjian Exp $
* *
* NOTES * NOTES
* this is the "main" module of the postgres backend and * this is the "main" module of the postgres backend and
@ -27,13 +27,9 @@
#include <time.h> #include <time.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN on most */ #include <sys/param.h> /* for MAXHOSTNAMELEN on most */
#ifndef WIN32 #ifndef MAXHOSTNAMELEN
#include <netdb.h> /* for MAXHOSTNAMELEN on some */ #include <netdb.h> /* for MAXHOSTNAMELEN on some */
#ifndef MAXHOSTNAMELEN /* for MAXHOSTNAMELEN everywhere else */
#include <arpa/nameser.h>
#define MAXHOSTNAMELEN MAXDNAME
#endif #endif
#endif /* WIN32 */
#include <errno.h> #include <errno.h>
#ifdef PORTNAME_aix #ifdef PORTNAME_aix
#include <sys/select.h> #include <sys/select.h>
@ -1269,7 +1265,7 @@ PostgresMain(int argc, char *argv[])
*/ */
if (IsUnderPostmaster == false) { if (IsUnderPostmaster == false) {
puts("\nPOSTGRES backend interactive interface"); puts("\nPOSTGRES backend interactive interface");
puts("$Revision: 1.9 $ $Date: 1996/10/04 20:16:32 $"); puts("$Revision: 1.10 $ $Date: 1996/10/13 04:49:57 $");
} }
/* ---------------- /* ----------------

View File

@ -28,9 +28,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN on most */ #include <sys/param.h> /* for MAXHOSTNAMELEN on most */
#if defined(PORTNAME_sparc_solaris) || defined(PORTNAME_i386_solaris) #ifndef MAXHOSTNAMELEN
#include <netdb.h> /* for MAXHOSTNAMELEN on some */ #include <netdb.h> /* for MAXHOSTNAMELEN on some */
#endif #endif
#endif
#include "tmp/postgres.h" #include "tmp/postgres.h"
#include "tmp/libpq-fe.h" #include "tmp/libpq-fe.h"

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.4 1996/08/06 16:16:42 scrappy Exp $ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.5 1996/10/13 04:50:27 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -26,7 +26,10 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <sys/param.h> /* for MAX{HOSTNAME,PATH}LEN, NOFILE */ #include <sys/param.h> /* for MAXHOSTNAMELEN on most */
#ifndef MAXHOSTNAMELEN
#include <netdb.h> /* for MAXHOSTNAMELEN on some */
#endif
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <pwd.h> #include <pwd.h>