> #define addr 192.186.2.5
> #define mask 255.255.240.0
> 
> #define rule(ADDR,MASK) add pass tcp from ADDR ## : ## MASK to any 25 setup
> rule(addr,mask)

This is a well-known artifact of the ANSI C rules.  You need to do two levels 
of macro in order to get the macro args expanded in the paste operator:

        #define addr 1.2.3.4
        #define mask 255.255.255.0

        #define hn(A,M) A ## : ## M

        #define rule(A,M) add pass tcp from hn(A,M) to any 25 setup

        rule(addr, mask)

which produces
        add pass tcp from   1.2.3.4:255.255.255.0     to any 25 setup 

when fed through an ANSI preprocessor (i.e. not "gcc -E" and not /usr/bin/cpp
on 3.x!).  This also works if (e.g.) addr is defined on the command line.





To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to