If memory serves me right, Daniel Jacobowitz wrote:
> On Fri, Sep 28, 2001 at 06:40:22PM -0400, Matt Zimmerman wrote:

> > I believe Linux is the OS that pchar woks on that uses different names for
> > the members of struct udphdr.  Until now, _BSD_SOURCE has provided a way to
> > have things "just work" on Linux.  Is it now necessary to do:

Just for the record, Linux is the only OS I've tried to run on where
this is needed.  I did the compatability hacks in pc.h a couple years
ago, with the help of one of my cow-orkers, who was running Slackware.

> > #if defined(__linux__) && defined(__GLIBC__)
> > #define uh_sport source
> > #define uh_dport dest
> > #define uh_ulen len
> > #define uh_sum check
> > #endif
> > 
> > in the pchar source?  Would that conditional be correct in all cases?

What about the other defines in the original code (for ICMP, etc.)?  It 
seems like glibc 2 systems still need them.

> ... no, not really.  You probably want to add !defined (__FAVOR_BSD)
> to that.

So it's:

        #if defined(__linux__) && defined(__GLIBC__) && !defined(__FAVOR_BSD)

        /* defines go in here */

        #endif

Is that right?  What happens on a non-Linux system running glibc?  (Or 
is this not a case that's likely to occur?)

Thanks, all!

Bruce.



Attachment: pgpCDzq0Sw5Vb.pgp
Description: PGP signature

Reply via email to