I wrote:
> 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.
and of course I _meant_ to write "(i.e. "gcc -E" and not /usr/bin/cpp..."
gcc -E _is_ an ANSI cpp.
To Unsubscribe: send mail to
> #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 o
Jim Bloom <[EMAIL PROTECTED]> writes:
> That small test works fine, but doesn't solve the problem I was having.
Oops. Sorry.
kai
--
~/.signature: No such file or directory
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message
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
Kai Großjohann wrote:
>
> /
> | $ cat foo
> | #define rule(ADDR,MASK) add pass tcp from ADDR ## : ## MASK to any 25 setup
> | rule(192.168.2.5,255.255.254.0)
> | $ type cpp
> | cpp is hashed (/usr/bin/cpp)
> | $ cpp foo
> | # 1 "foo"
> |
> | add pass tcp from 192.168.2.5:255.255.254.0 to an
Jim Bloom <[EMAIL PROTECTED]> writes:
> No. It has the same bug. That method of concatenation only works
> for strings.
Well, I tried it and got the following:
/
| $ cat foo
| #define rule(ADDR,MASK) add pass tcp from ADDR ## : ## MASK to any 25 setup
| rule(192.168.2.5,255.255.254.0)
| $
No. It has the same bug. That method of concatenation only works for strings.
Jim Bloom
[EMAIL PROTECTED]
Kai Großjohann wrote:
> /
> | #define rule(ADDR,MASK) \
> | add pass tcp from ADDR ## : ## MASK to any 25 setup
> |
> | rule(192.168.2.5,255.255.254.0)
> \
>
> Does it do what you
Jim Bloom <[EMAIL PROTECTED]> writes:
> On the old version of current this expands to
>
> add pass tcp from 192.168.2.5:255.255.254.0 to any 25 setup
>
> but on a new version of current this expands to
>
> add pass tcp from 192.168.2.5 : 255.255.254.0 to any 25 setup
You might wis
On Sun, Feb 27, 2000 at 12:48:53AM -0500, Jim Bloom wrote:
> but on a new version of current this expands to
>
> add pass tcp from 192.168.2.5 : 255.255.254.0 to any 25 setup
>
> Note the extra spaces around the colon.
This is required by the ANSI-C spec. Tokens replaced by `cpp' shall b
On Sun, Feb 27, 2000 at 12:48:53AM -0500, Jim Bloom wrote:
> I have been using cpp on my firewall to expand my local firewall rules and fill
> in the local address and subnetmask. This makes things easier my ISP decides to
> change my IP address using DHCP. My firewall is running an approximatel
I have been using cpp on my firewall to expand my local firewall rules and fill
in the local address and subnetmask. This makes things easier my ISP decides to
change my IP address using DHCP. My firewall is running an approximately one
year old version of current and I'm trying to upgrade it to
11 matches
Mail list logo