From cb6cb7745d426e712314f6b92e79a63bd32b3759 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Sat, 28 Dec 1996 02:13:05 +0000
Subject: [PATCH] Here's the final set of patches to 6.0 (sup'd on 27/12/96)
 that allow a full gmake of the code without interruption.

There's also some tidy-up of the MAXPATHLEN stuff based on the assumption that
all supported platforms have MAXPATHLEN defined in <sys/param.h>.

(The only unknowns for the above are AIX and IRIX5.)
---
 src/Makefile.global                          |  4 +++-
 src/backend/port/sparc_solaris/port-protos.h |  6 ++++--
 src/backend/postmaster/Makefile              | 13 ++++++++++++-
 src/backend/utils/adt/numutils.c             |  8 ++++----
 src/bin/psql/psql.c                          |  3 ++-
 src/include/config.h                         | 10 +++-------
 src/include/utils/dynamic_loader.h           | 10 ++--------
 src/interfaces/libpq/fe-lobj.c               |  6 +-----
 8 files changed, 31 insertions(+), 29 deletions(-)

diff --git a/src/Makefile.global b/src/Makefile.global
index a0fe48fd97c..6ff5e585902 100644
--- a/src/Makefile.global
+++ b/src/Makefile.global
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.78 1996/12/26 17:39:58 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.79 1996/12/28 02:11:37 momjian Exp $
 #
 # NOTES
 #    Essentially all Postgres make files include this file and use the 
@@ -516,6 +516,7 @@ INSTALL= /usr/ucb/install
 # accessing headers in the backend directory.
 CFLAGS_BE= -I$(SRCDIR)/backend/port/sparc_solaris
 LDADD_BE= -lsocket -lnsl -ll -ldl
+LD_ADD= -lsocket -lnsl
 
 ifeq ($(CC), cc)
 CFLAGS_SL= -K PIC
@@ -610,6 +611,7 @@ ifeq ($(PORTNAME), sparc_solaris)
 CC= gcc
 
 LDADD_BE= -lsocket -lnsl -ll -ldl
+LD_ADD= -lsocket -lnsl
 
 # RANLIB is not used on solaris
 RANLIB= touch
diff --git a/src/backend/port/sparc_solaris/port-protos.h b/src/backend/port/sparc_solaris/port-protos.h
index 9804c48ac95..01c073e9570 100644
--- a/src/backend/port/sparc_solaris/port-protos.h
+++ b/src/backend/port/sparc_solaris/port-protos.h
@@ -6,16 +6,18 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: port-protos.h,v 1.2 1996/11/27 08:15:23 bryanh Exp $
+ * $Id: port-protos.h,v 1.3 1996/12/28 02:11:49 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #ifndef PORT_PROTOS_H
 #define PORT_PROTOS_H
 
+#include <netinet/in.h>        /* For struct in_addr */
+#include <arpa/inet.h>
+
 #include <dlfcn.h>
 
-#include "config.h"   /* For MAXPATHLEN */
 #include "fmgr.h"			/* for func_ptr */
 #include "utils/dynamic_loader.h"
 
diff --git a/src/backend/postmaster/Makefile b/src/backend/postmaster/Makefile
index c83f541f4a1..7a771db8eb0 100644
--- a/src/backend/postmaster/Makefile
+++ b/src/backend/postmaster/Makefile
@@ -4,7 +4,7 @@
 #    Makefile for postmaster
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/backend/postmaster/Makefile,v 1.3 1996/11/09 06:20:48 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/backend/postmaster/Makefile,v 1.4 1996/12/28 02:12:04 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -17,6 +17,17 @@ INCLUDE_OPT = -I.. \
 
 CFLAGS+=$(INCLUDE_OPT)
 
+ifeq ($(PORTNAME), sparc_solaris)
+
+ifeq ($(CC), gcc)
+# Until we figure out how to get rid of the warnings in this directory,
+# we must turn off any -Werror that is in CFLAGS now.  These options only
+# exist for the gcc compiler.
+CFLAGS+= -Wno-error
+endif
+
+endif
+
 OBJS = postmaster.o
 
 all: SUBSYS.o
diff --git a/src/backend/utils/adt/numutils.c b/src/backend/utils/adt/numutils.c
index db253172b2f..0f17fa1d2f8 100644
--- a/src/backend/utils/adt/numutils.c
+++ b/src/backend/utils/adt/numutils.c
@@ -10,7 +10,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.7 1996/11/27 08:15:54 bryanh Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.8 1996/12/28 02:12:17 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -156,9 +156,9 @@ ftoa(double value, char *ascii, int width, int prec1, char format)
 #else
     auto int	expon;
     auto int	sign;
-    register int	avail;
-    register char	*a;
-    register char	*p;
+    register int	avail = 0;
+    register char	*a = NULL;
+    register char	*p = NULL;
     char		mode;
     int		lowercase;
     int		prec;
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c
index 4b8583d7031..a32d2c69ee5 100644
--- a/src/bin/psql/psql.c
+++ b/src/bin/psql/psql.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.42 1996/12/26 22:07:57 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.43 1996/12/28 02:12:31 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -16,6 +16,7 @@
 #include <signal.h>
 #include <errno.h>
 #include <sys/types.h>
+#include <sys/param.h>	/* for MAXPATHLEN */
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
diff --git a/src/include/config.h b/src/include/config.h
index 8e4d841c1ac..f7042b92995 100644
--- a/src/include/config.h
+++ b/src/include/config.h
@@ -8,13 +8,6 @@
 
 #define BLCKSZ	8192
 
-/* Found in catalog/catalog.c, but doesn't seem to do anything in there */
-#if !defined(sparc_solaris)
-#ifndef MAXPATHLEN
-#define MAXPATHLEN      80
-#endif
-#endif /* !defined(sparc_solaris) */
-
 #if defined(aix)
 #define TERMIOS_H_LOCATION <termios.h>
 #else
@@ -200,6 +193,9 @@ typedef unsigned char slock_t;
 #  define HAVE_TZSET
 #  define NEED_CBRT
 #  define NEED_ISINF
+#  ifndef MAXPATHLEN
+#  define MAXPATHLEN    250
+#  endif
 #endif /* WIN32 */
 
 #if defined(ultrix4)
diff --git a/src/include/utils/dynamic_loader.h b/src/include/utils/dynamic_loader.h
index f4f9c7163b9..a2e8fa4027b 100644
--- a/src/include/utils/dynamic_loader.h
+++ b/src/include/utils/dynamic_loader.h
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: dynamic_loader.h,v 1.3 1996/11/26 03:20:17 bryanh Exp $
+ * $Id: dynamic_loader.h,v 1.4 1996/12/28 02:12:51 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -14,6 +14,7 @@
 #define DYNAMIC_LOADER_H
 
 #include <sys/types.h>
+#include <sys/param.h>	/* For MAXPATHLEN */
 
 #include <postgres.h>
 
@@ -22,13 +23,6 @@
 #undef MAX
 #endif /* MIN */
 
-#ifdef WIN32
-#define MAXPATHLEN    250
-#endif
-
-#ifdef WIN32
-#endif
-
 /*
  * List of dynamically loaded files.
  */
diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 269df14e630..563af3e46f2 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.5 1996/11/16 05:18:58 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.6 1996/12/28 02:13:05 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -21,10 +21,6 @@
 #include "libpq-fe.h"
 #include "libpq/libpq-fs.h"
 
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 1024
-#endif
-
 #define LO_BUFSIZE        1024
 
 static int lo_initialize(PGconn *conn);
-- 
GitLab