Subject: FVWM: Compiling fvwm2 on SCO 5.0.2 - cpp problems

From: Maxwell Spangler <[email-masked]>
Date: Wed, 30 Apr 1997 13:57:50 -0400

I'm continuing my attempt to compile the fvwm2 window manager on my SCO
OpenServer 5.0.2 system. (It's basically unusable until I can get this
done! please help!)

Users have suggested I look into c preprocessor macro expansion problems
which we believe are causing at least part of my problem.

It appears as though the expanded macros have more spaces in them than
the c compiler would like to see.

Here's a snippet from the original code, in add_window.c:

----------------------------------------------------------------
/* ORIGINAL CODE WHICH CAUSES SCO COMPILER TO PRODUCE AN ERROR
  tmp_win->title_height = GetDecor(tmp_win,TitleHeight) + tmp_win->bw;
*/

/* THIS LINE, WHICH SHOULD BE EXPANED BY THE MACRO, COMPILES. */
  tmp_win->title_height = ( ( tmp_win )->fl->TitleHeight ) +
tmp_win->bw;
------------------------------------------------------------------

This is what cc -E add_window.c (with all other Makefile options like
-DUSEDECOR added, also.)

# 227
  tmp_win->title_height =  ( ( tmp_win ) -> fl ->TitleHeight ) + tmp_win
-> bw ;

I'm guessing that with the extra spaces, the compiler doesn't recognize
-> for pointers and is producing errors.  The above code is exactly this
minus the spaces and seems to compile fine.

Here's the macro, unmodified:
---------------------------------------------------------------------
/* FROM screen.h THE ORIGINAL MACRO CODE
   Macro which gets specific decor or default decor.
   This saves an indirection in case you don't want
   the UseDecor mechanism.
 */
#ifdef USEDECOR     /* THIS IS WHAT i WANT TO USE */
#define GetDecor(window,part) ((window)->fl->##part)
#else
#define GetDecor(window,part) (Scr.DefaultDecor.##part)
#endif
------------------------------------------------------------------------

I'd appreciate any help, especially if there are c/cpp switches I can
use to overcome this.  I'm 80% done, but this last 20% is not so easy.

THANKS! (PLEASE HELP!?!)
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: David Nugent <[email-masked]>
Date: Thu, 01 May 1997 11:13:18 +1000

> -> for pointers and is producing errors.

Then the compiler's parser is broken. Both lines of code are syntactically
identical.

IMHO, get and install gcc. I don't know which version of "SCO" you're using,
but in the R3.2 days circa 1991 or so, their compiler is very, very broken.
We used gcc for any reasonably sized projects, relegating SCO's only to
building device drivers and reconfiguring/relinking the kernel.