Subject: Re: problems in libg++-2.6.2 compile
To: Rob Healey <rhealey@kas.helios.mn.org>
From: Greg Hudson <ghudson@MIT.EDU>
List: current-users
Date: 02/18/1995 15:25:10
I've included the patches I needed to get libg++-2.6.1 to build under
NetBSD.  I also have in my NOTES file for libg++-2.6.1:

	The generator for _G_config.h fails on fpos_t under NetBSD,
	because it generates a "typedef quad_t _G_fpos_t".  This needs
	to be fixed by hand for now.

"fixed by ahnd for now" meant editing _G_config.h to do "typedef long
long _G_fpos_t" instead of "typedef quad_t _G_fpos_t".  There might
have been a problem with another type as well.

The following patches were submitted to bug-libg++, so they may be
unnecessary for libg++-2.6.2.  (I'm unable to get through to prep.ai
right now, so I can't even check whether there is a libg++-2.6.2; I
had thought 2.6.1 was the latest version.)

*** libg++/src/Fix.cc.orig      Fri Dec 16 14:34:01 1994
--- libg++/src/Fix.cc   Fri Dec 16 14:35:21 1994
***************
*** 298,304 ****
      r = new_Fix(x->len + y->len);
    int xsign = x->s[0] & 0x8000,
      ysign = y->s[0] & 0x8000;
!   Fix X(x->len), Y(y->len);
    if ( xsign )
      x = negate(x,X.rep);
    if ( ysign )
--- 298,304 ----
      r = new_Fix(x->len + y->len);
    int xsign = x->s[0] & 0x8000,
      ysign = y->s[0] & 0x8000;
!   Fix X((int)x->len), Y((int)y->len);
    if ( xsign )
      x = negate(x,X.rep);
    if ( ysign )
***************
*** 368,374 ****
      negate(x,r);
    else
      copy(x,r);
!   Fix Y(y->len);
    Rep* y2 = ( ysign ? negate(y,Y.rep) : copy(y,Y.rep) );
    if ( !compare(y2) )
      range_error("division -- division by zero");
--- 368,374 ----
      negate(x,r);
    else
      copy(x,r);
!   Fix Y((int)y->len);
    Rep* y2 = ( ysign ? negate(y,Y.rep) : copy(y,Y.rep) );
    if ( !compare(y2) )
      range_error("division -- division by zero");
***************
*** 383,389 ****
    else
    {
      Rep* t;
!     Fix S(r->len),
        W(q->len,&Rep_quotient_bump);
      for ( int i=1; i < q->len; i++ )
      {
--- 383,389 ----
    else
    {
      Rep* t;
!     Fix S((int)r->len),
        W(q->len,&Rep_quotient_bump);
      for ( int i=1; i < q->len; i++ )
      {
*** libg++/src/CursesW.h.orig   Mon Oct 24 19:06:47 1994
--- libg++/src/CursesW.h        Fri Dec 16 14:45:59 1994
***************
*** 31,36 ****
--- 31,47 ----
  #include   <curses.h>
  }
  
+ /* NetBSD uses different field names. */
+ #ifdef __NetBSD__
+ #define _maxx maxx
+ #define _maxy maxy
+ #define _curx curx
+ #define _cury cury
+ #define _y lines
+ #define _begx begx
+ #define _begy begy
+ #endif
+ 
  /* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro.
     Undefine it here, because CursesWindow uses lines as a method.  */
  #undef lines
*** libg++/src/timer.c.orig     Fri Dec 16 14:55:06 1994
--- libg++/src/timer.c  Fri Dec 16 14:55:31 1994
***************
*** 31,36 ****
--- 31,37 ----
  
  #include <_G_config.h>
  #if _G_HAVE_SYS_RESOURCE
+ #include <sys/types.h>
  #include <sys/time.h>
  #include <sys/resource.h>
  #endif
*** libio/gen-params.orig       Fri Dec 16 15:13:34 1994
--- libio/gen-params    Fri Dec 16 15:13:50 1994
***************
*** 520,525 ****
--- 520,526 ----
   echo "#define ${macro_prefix}HAVE_SYS_RESOURCE ${HAVE_SYS_RESOURCE}"
  else
    cat >dummy.c <<!EOF!
+ #include <sys/types.h>
  #include <sys/time.h>
  #include <sys/resource.h>
    int main()