On Thu, Apr 18, 2002 at 04:02:21PM -0500, David Scott Page wrote:
> Enclosed, please find a patch to modify the preprocessor test for
> __STDC__ in net/bpf.h from the PCAP distribution. In general, __STDC__
> will not be equal to 1 (non-zero) for C++ compilers, since, by
> definition, they do not implement ANSI standard C.  It seems though
> that __STDC__ is typically *defined* by C++ compilers, hence this
> patch satisfies at least the Sun CC and KAI KCC compilers when pcap.h
> is included.

Then the right fix is probably to change the non-kernel

        #if __STDC__

to

        #if __STDC__ || defined(__cplusplus)

The

        #if __STDC__

needn't change unless somebody uses that code in some kernel and calls
it from C++ code.

You also need to wrap the whole thing in

        #ifdef __cplusplus
        extern "C" {
        #endif

and

        #ifdef __cplusplus
        }
        #endif

I've checked in both of those changes.

> (why bpf_filter and bpf_validate are declared in both
> pcap.h and net/bpf.h is another issue)

...and one to which I don't know the answer.  Anybody else?
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to