[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems concerning preprocessor macros in ifconf.c
From: |
Martin Jost |
Subject: |
Re: Problems concerning preprocessor macros in ifconf.c |
Date: |
Tue, 26 Mar 2002 17:32:17 +0100 |
David Masterson wrote:
>
> > # ifdef HAVE_ORTENTRY
> > struct ortentry route;
> > -# else if HAVE_RTENTRY
> > +# elif HAVE_RTENTRY
> > struct rtentry route;
> > # endif
> If I recall correctly, some compilers preferred "#else if" while
> others preferred "#elif" (ANSI is "#elif"). So, for the greatest
> portability, this should probably be written as:
>
> #ifdef HAVE_ORTENTRY
> ..
> #else
> #ifdef HAVE_RTENTRY
> ..
> #endif
> #endif
Yes, probably this would be the most generic way. I hoped for some
smaller but still standard way...
> Did you test your "else if"? I don't think that does what you want.
"else if" is the way I found in the original file. Note the the diff
is from 'original' to 'patched'
Martin