Jim Bloom <[EMAIL PROTECTED]> wrote:
>
>That small test works fine, but doesn't solve the problem I was having. Try
>this small test case to see my problem:
>
>#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 also does not work if addr and mask are defined on the command line. The
>problem arises from using another defined value as the string being
>concatenated. The concatenation works for constants though.
You need to use a two-macro trick similar to the one for stringizing
in K&R2:
$ gcc -E -
#define addr 1.2.3.4
#define mask 5.6.7.8
#define cat_helper(a,b) a ## : ## b
#define cat(a,b) cat_helper(a,b)
cat(addr,mask)
# 1 ""
1.2.3.4:5.6.7.8
$
Tony.
--
f.a.n.finch [EMAIL PROTECTED] [EMAIL PROTECTED]
455 wetness and warmth for wussies
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message