[comp.mail.uucp] Problems with compiling rn

dt@mathcs.emory.edu (Dave Taylor {guest}) (03/07/90)

I recently ftp'ed a copy of the latest and greatest copy of r.44.tar.Z
After getting onto my system and tweeking the config.h file slightly
I have continued to try and get it compile fully.

I am running on SCO Xenix 2.3.2 and it is croaking on the term.c routine.
It doesn't seem to like the following section of code:


#ifdef PENDING
#ifndef FIONREAD
int
circfill()
{
    register int howmany = read(devtty,circlebuf+nextin,1);

    if (howmany) {
	nextin += howmany;
	nextin %= PUSHSIZE;
    }
    return howmany;
}
#endif PENDING
#endif FIONREAD


Here are the errors from the compiler...

	cc -c -O term.c
term.c
term.c(600) : warning 3: not enough actual parameters for macro 'howmany'
term.c(600) : error 59: syntax error : ')'
term.c(602) : warning 1: macro 'howmany' requires parameters
term.c(602) : error 59: syntax error : ')'
term.c(602) : error 59: syntax error : ')'
term.c(602) : error 59: syntax error : '{'
term.c(603) : warning 1: macro 'howmany' requires parameters
...
... (eventual croak)

If you could be of help please let me know.  I'm not a C master, so I'll
have to hope that you can help me out of this one.

Thanks in advance.

-david

rodeen@buddha.ncc.umn.edu (Rick Odeen) (03/07/90)

In article <5108@emory.mathcs.emory.edu> dt@emory.UUCP (Dave Taylor {guest}) writes:
 >I recently ftp'ed a copy of the latest and greatest copy of r.44.tar.Z
 >After getting onto my system and tweeking the config.h file slightly
 >I have continued to try and get it compile fully.
 >
...

 >Here are the errors from the compiler...
 >
 >	cc -c -O term.c
 >term.c
 >term.c(600) : warning 3: not enough actual parameters for macro 'howmany'
 >term.c(600) : error 59: syntax error : ')'
 >term.c(602) : warning 1: macro 'howmany' requires parameters
 >term.c(602) : error 59: syntax error : ')'
 >term.c(602) : error 59: syntax error : ')'
 >term.c(602) : error 59: syntax error : '{'
 >term.c(603) : warning 1: macro 'howmany' requires parameters
 >...
 >... (eventual croak)
 >

The problem is that the name howmany is used in sys/types.h as follows:

#define howmany(x, y)	(((x)+((y)-1))/(y))

I think I just renamed howmany in rn to something else.



-- 
Rick Odeen                                    ...!rutgers!umn-cs!buddha!rodeen
Nutrition Coordinating Center                        rodeen@buddha.ncc.umn.edu 
University of Minnesota                                  AT&T: +1 612 627 4884

chip@chinacat.Lonestar.ORG (Chip Rosenthal) (03/07/90)

<5108@emory.mathcs.emory.edu> dt@emory.UUCP (Dave Taylor {guest}) writes:
>I am running on SCO Xenix 2.3.2 and it is croaking on the term.c routine.
>	cc -c -O term.c
>term.c
>term.c(600) : warning 3: not enough actual parameters for macro 'howmany'

My patches for rn-pl44 under XENIX are currently in test.  If all goes
well, hopefully I can twist Stan's arm enough to get them in a future
official release.  Below is the "term.c" portion of the patch set.  It
will fix this problem.

Index: term.c
*** Distrib-pl44/term.c	Fri Feb  9 17:41:44 1990
--- term.c	Thu Feb  8 13:09:41 1990
***************
*** 1,5 ****
--- 1,9 ----
  /* $Header: term.c,v 4.3.2.3 89/11/28 01:51:58 sob Locked $
   *
+  * Thu Feb  8 13:08:31 1990 - Chip Rosenthal <chip@chinacat.Lonestar.ORG>
+  *	Correct two calls to puts() which should have been fputs().
+  *	Removed conflict with XENIX howmany() macro.
+  *
   * $Log:	term.c,v $
   * Revision 4.3.2.3  89/11/28  01:51:58  sob
   * Now handles SIGWINCH correctly.
***************
*** 295,301 ****
  	    garbage = 0;
  	if (s[1]) {
  	    if ((curmap->km_type[ch] & KM_TMASK) == KM_STRING) {
! 		puts(override,stdout) FLUSH;
  		free(curmap->km_ptr[ch].km_str);
  		curmap->km_ptr[ch].km_str = Nullch;
  	    }
--- 299,305 ----
  	    garbage = 0;
  	if (s[1]) {
  	    if ((curmap->km_type[ch] & KM_TMASK) == KM_STRING) {
! 		fputs(override,stdout) FLUSH;
  		free(curmap->km_ptr[ch].km_str);
  		curmap->km_ptr[ch].km_str = Nullch;
  	    }
***************
*** 306,312 ****
  	}
  	else {
  	    if ((curmap->km_type[ch] & KM_TMASK) == KM_KEYMAP)
! 		puts(override,stdout) FLUSH;
  	    else {
  		curmap->km_type[ch] = KM_STRING + garbage;
  		curmap->km_ptr[ch].km_str = savestr(m);
--- 310,316 ----
  	}
  	else {
  	    if ((curmap->km_type[ch] & KM_TMASK) == KM_KEYMAP)
! 		fputs(override,stdout) FLUSH;
  	    else {
  		curmap->km_type[ch] = KM_STRING + garbage;
  		curmap->km_ptr[ch].km_str = savestr(m);
***************
*** 597,602 ****
--- 601,609 ----
  int
  circfill()
  {
+ #ifdef howmany
+ #   undef howmany	/* defined as a macro in XENIX's <sys/types.h> */
+ #endif
      register int howmany = read(devtty,circlebuf+nextin,1);
  
      if (howmany) {
<<< end of patch >>>
-- 
Chip Rosenthal                            |  Yes, you're a happy man and you're
chip@chinacat.Lonestar.ORG                |  a lucky man, but are you a smart
Unicom Systems Development, 512-482-8260  |  man?  -David Bromberg