FVWM: Compiling fvwm2 on SCO 5.0.2 - cpp problems

From: Maxwell Spangler <maxwell_at_clark.net>
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 majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Wed Apr 30 1997 - 13:00:09 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:00 BST