UnixWare 7.x port updates.

Started by Billy G. Allieover 27 years ago5 messages
#1Billy G. Allie
Bill.Allie@mug.org
1 attachment(s)

Recent additions to the PostgreSQL 6.4 tree broke the UnixWare 7.x port. Here
are the patches to fix them:

1. In 'src/backend/utils/adt/ip.c', the functions 'ipaddr_eq()' and
'ipaddr_ge()' were used before being defined. I reordered the functions so
that they were defined before being used.

2. In 'src/include/utils/mac.h', I included the file 'sys/bitypes.h' if the
code is being compiled by a USL compiler (i.e. UnixWare). This is needed
to define the 'u_int32_t' type.

3. In 'src/include/c.h', I add a check to see if 'bool' had been defined as a
macro before attempting to typeset it. In some instances, 'bool' is
defined as a macro that expands to 'char'. The UnixWare compiler complains
if you try to compile "typeset char char;".

4. In 'src/pl/plpgsql/src/pl_exec.c', there is a construct that is incorrect.
This construct is '((int4)(var->value))--' and '((int4)(var->value))++'.
What this is saying is to take result of the expression '(var->value)',
cast it as an 'int4', and then increment it. This can not work as the
result of the expression is not an 'LVALUE' and thus can not be the target
of the '--' or the '++' operator. What is needed is '(int4)var->value--'
or '(int4)var->value++' [assuming the desired result is to decrement(in-
crement) 'var->value' as if it were an 'int4'].

5. In 'src/test/regress/checkresults', the use of the '-u' option is assuming
the use of GNU diff.

There were some additional portability problems with the make file for plpgsql
that I do not address with these patches. I will supply a Makefile.in for
plpgsql that will address these problems shortly.

The UnixWare 7.x port now passes the regression tests except for differences
in the some error messages and floating point precision.

BTW: The plpgsql language seems to working well, at least for the simple
things that I am currently using them for.

Thanks Jan for the good work on PL/pgsql!

Attachments:

uw7.patchapplication/x-patch; name=uw7.patchDownload
*** src/backend/utils/adt/ip.c.orig	Sat Oct  3 19:39:44 1998
--- src/backend/utils/adt/ip.c	Sat Oct  3 19:40:47 1998
***************
*** 127,138 ****
  }
  
  bool
- ipaddr_le(ipaddr *a1, ipaddr *a2)
- {
- 	return (ipaddr_lt(a1, a2) || ipaddr_eq(a1, a2));
- }
- 
- bool
  ipaddr_eq(ipaddr *a1, ipaddr *a2)
  {
  	if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET))
--- 127,132 ----
***************
*** 150,158 ****
  }
  
  bool
! ipaddr_ge(ipaddr *a1, ipaddr *a2)
  {
! 	return (ipaddr_gt(a1, a2) || ipaddr_eq(a1, a2));
  }
  
  bool
--- 144,152 ----
  }
  
  bool
! ipaddr_le(ipaddr *a1, ipaddr *a2)
  {
! 	return (ipaddr_lt(a1, a2) || ipaddr_eq(a1, a2));
  }
  
  bool
***************
*** 171,176 ****
--- 165,176 ----
  			 ip_family(a1), ip_family(a2));
  		return (FALSE);
  	}
+ }
+ 
+ bool
+ ipaddr_ge(ipaddr *a1, ipaddr *a2)
+ {
+ 	return (ipaddr_gt(a1, a2) || ipaddr_eq(a1, a2));
  }
  
  bool
*** src/include/utils/mac.h.orig	Sat Oct  3 16:09:28 1998
--- src/include/utils/mac.h	Sat Oct  3 16:13:40 1998
***************
*** 14,19 ****
--- 14,28 ----
  #define MAC_H
  
  /*
+  * UnixWare needs to include sys/bitypes.h in order to have u_int32_t
+  * defined.
+  */
+ 
+ #if defined(__USLC__)
+ #include <sys/bitypes.h>
+ #endif
+ 
+ /*
   *	This is the internal storage format for IP addresses:
   */
  
*** src/include/c.h.orig	Sat Oct  3 14:29:55 1998
--- src/include/c.h	Sat Oct  3 14:30:42 1998
***************
*** 61,68 ****
  #define false	((char) 0)
  #define true	((char) 1)
  #ifndef __cplusplus
  typedef char bool;
! 
  #endif	 /* not C++ */
  typedef bool *BoolPtr;
  
--- 61,69 ----
  #define false	((char) 0)
  #define true	((char) 1)
  #ifndef __cplusplus
+ #ifndef bool
  typedef char bool;
! #endif   /* ndef bool */
  #endif	 /* not C++ */
  typedef bool *BoolPtr;
  
*** src/pl/plpgsql/src/pl_exec.c.orig	Sat Oct  3 21:32:12 1998
--- src/pl/plpgsql/src/pl_exec.c	Sat Oct  3 21:40:37 1998
***************
*** 1243,1251 ****
  		 * ----------
  		 */
  		if (stmt->reverse)
! 			((int4) (var->value))--;
  		else
! 			((int4) (var->value))++;
  	}
  
  	return PLPGSQL_RC_OK;
--- 1243,1251 ----
  		 * ----------
  		 */
  		if (stmt->reverse)
! 			(int4)var->value--;
  		else
! 			(int4)var->value++;
  	}
  
  	return PLPGSQL_RC_OK;
*** src/test/regress/checkresults.orig	Sun Oct  4 03:22:40 1998
--- src/test/regress/checkresults	Sun Oct  4 03:29:30 1998
***************
*** 7,13 ****
  for file in `cat "$@" | grep 'failed$' | cut -d " " -f 1`
  do
  	echo "======   $file   ======"
! 	diff -uw expected/$file.out results
  done
  
  
--- 7,13 ----
  for file in `cat "$@" | grep 'failed$' | cut -d " " -f 1`
  do
  	echo "======   $file   ======"
! 	diff -w expected/$file.out results
  done
  
  
#2Thomas G. Lockhart
lockhart@alumni.caltech.edu
In reply to: Billy G. Allie (#1)
Re: [HACKERS] UnixWare 7.x port updates.

The UnixWare 7.x port now passes the regression tests except for
differences in the some error messages and floating point precision.

Got the report. Will assume that your patches will make it into the
distribution, and will update the porting information for your platform.
Could you please let us know if anything gets broken, or if your patches
don't get in completely so you continue to have a broken port?

TIA

- Tom

#3Egon Schmid
eschmid@delos.stuttgart.netsurf.de
In reply to: Thomas G. Lockhart (#2)
tcl support broken

Hi all,
if I ./configure with tcl then make reports:

make[2]: Entering directory `/usr/local/pgsql/src/pl/tcl'
'cc -shared' -o pltcl.so pltcl.o '-ltcl8.0' '-L/usr/lib -ltcl8.0' '-ldl
-lieee -lm'
make[2]: cc -shared: Command not found
make[2]: *** [pltcl.so] Error 127

-Egon

#4Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Billy G. Allie (#1)
Re: [HACKERS] UnixWare 7.x port updates.

Recent additions to the PostgreSQL 6.4 tree broke the UnixWare 7.x port. Here
are the patches to fix them:

1. In 'src/backend/utils/adt/ip.c', the functions 'ipaddr_eq()' and
'ipaddr_ge()' were used before being defined. I reordered the functions so
that they were defined before being used.

I was not including builtin.h as I should have. Fixed now.

2. In 'src/include/utils/mac.h', I included the file 'sys/bitypes.h' if the
code is being compiled by a USL compiler (i.e. UnixWare). This is needed
to define the 'u_int32_t' type.

I have changed u_int32_t to unsigned int. No reason to use u_int32_t.

3. In 'src/include/c.h', I add a check to see if 'bool' had been defined as a
macro before attempting to typeset it. In some instances, 'bool' is
defined as a macro that expands to 'char'. The UnixWare compiler complains
if you try to compile "typeset char char;".

4. In 'src/pl/plpgsql/src/pl_exec.c', there is a construct that is incorrect.
This construct is '((int4)(var->value))--' and '((int4)(var->value))++'.
What this is saying is to take result of the expression '(var->value)',
cast it as an 'int4', and then increment it. This can not work as the
result of the expression is not an 'LVALUE' and thus can not be the target
of the '--' or the '++' operator. What is needed is '(int4)var->value--'
or '(int4)var->value++' [assuming the desired result is to decrement(in-
crement) 'var->value' as if it were an 'int4'].

5. In 'src/test/regress/checkresults', the use of the '-u' option is assuming
the use of GNU diff.

I will apply the rest.

There were some additional portability problems with the make file for plpgsql
that I do not address with these patches. I will supply a Makefile.in for
plpgsql that will address these problems shortly.

The UnixWare 7.x port now passes the regression tests except for differences
in the some error messages and floating point precision.

BTW: The plpgsql language seems to working well, at least for the simple
things that I am currently using them for.

Thanks Jan for the good work on PL/pgsql!

Content-Description: uw7.patch

[Attachment, skipping...]

____ | Billy G. Allie | Domain....: Bill.Allie@mug.org
| /| | 7436 Hartwell | Compuserve: 76337,2061
|-/-|----- | Dearborn, MI 48126| MSN.......: B_G_Allie@email.msn.com
|/ |LLIE | (313) 582-1540 |

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#5Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Billy G. Allie (#1)
Re: [HACKERS] UnixWare 7.x port updates.

Recent additions to the PostgreSQL 6.4 tree broke the UnixWare 7.x port. Here
are the patches to fix them:

1. In 'src/backend/utils/adt/ip.c', the functions 'ipaddr_eq()' and
'ipaddr_ge()' were used before being defined. I reordered the functions so
that they were defined before being used.

2. In 'src/include/utils/mac.h', I included the file 'sys/bitypes.h' if the
code is being compiled by a USL compiler (i.e. UnixWare). This is needed
to define the 'u_int32_t' type.

Fixed.

3. In 'src/include/c.h', I add a check to see if 'bool' had been defined as a
macro before attempting to typeset it. In some instances, 'bool' is
defined as a macro that expands to 'char'. The UnixWare compiler complains
if you try to compile "typeset char char;".

4. In 'src/pl/plpgsql/src/pl_exec.c', there is a construct that is incorrect.
This construct is '((int4)(var->value))--' and '((int4)(var->value))++'.
What this is saying is to take result of the expression '(var->value)',
cast it as an 'int4', and then increment it. This can not work as the
result of the expression is not an 'LVALUE' and thus can not be the target
of the '--' or the '++' operator. What is needed is '(int4)var->value--'
or '(int4)var->value++' [assuming the desired result is to decrement(in-
crement) 'var->value' as if it were an 'int4'].

5. In 'src/test/regress/checkresults', the use of the '-u' option is assuming
the use of GNU diff.

The rest are applied.

There were some additional portability problems with the make file for plpgsql
that I do not address with these patches. I will supply a Makefile.in for
plpgsql that will address these problems shortly.

The UnixWare 7.x port now passes the regression tests except for differences
in the some error messages and floating point precision.

BTW: The plpgsql language seems to working well, at least for the simple
things that I am currently using them for.

Thanks Jan for the good work on PL/pgsql!

Content-Description: uw7.patch

[Attachment, skipping...]

____ | Billy G. Allie | Domain....: Bill.Allie@mug.org
| /| | 7436 Hartwell | Compuserve: 76337,2061
|-/-|----- | Dearborn, MI 48126| MSN.......: B_G_Allie@email.msn.com
|/ |LLIE | (313) 582-1540 |

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026