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

From: Andrew Veliath <[email-masked]>
Date: Thu, 1 May 1997 16:11:19 -0400

Bela> Here's the problem.  Those token-paste operators ("##") are
    Bela> wrong.  ANSI C requires that in a ## b, all three of "a",
    Bela> "b", and the resulting pasted token, be valid preprocessor
    Bela> tokens.  "->TitleHeight" is not a valid token (it's *two*
    Bela> valid tokens).  Token pasting is not wanted here.  The
    Bela> macros should read:

    Bela>   #ifdef USEDECOR /* THIS IS WHAT i WANT TO USE */ #define
    Bela> GetDecor(window,part) ((window)->fl->part) #else #define
    Bela> GetDecor(window,part) (Scr.DefaultDecor.part) #endif

    Bela> The AT&T/USL/SCO compiler differs from gcc in this matter.
    Bela> It is not wrong.  gcc is interpreting the ANSI standard more
    Bela> loosely than SCO cc.

Bela: thanks for this solution.  Sorry, this was my blunder.

Chuck: please make sure this change below gets into the next release.

Regards,
Andrew

--- screen.h.orig	Thu May  1 16:03:09 1997
+++ screen.h	Thu May  1 16:03:34 1997
@@ -329,9 +329,9 @@
    the UseDecor mechanism.
  */
 #ifdef USEDECOR
-#define GetDecor(window,part) ((window)->fl->##part)
+#define GetDecor(window,part) ((window)->fl->part)
 #else
-#define GetDecor(window,part) (Scr.DefaultDecor.##part)
+#define GetDecor(window,part) (Scr.DefaultDecor.part)
 #endif
 
 /* some protos for the decoration structures */
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].