On 9/22/05, Joe Orton <[EMAIL PROTECTED]> wrote:
> On Wed, Sep 21, 2005 at 08:50:22PM -0600, D.J. Heap wrote:
> > On 9/21/05, Joe Orton <[EMAIL PROTECTED]> wrote:
> > > > I also had to tweak the ne_xml.c file where it is testing for the
> > > > XML_MAJOR_VERSION.  The MS compiler doesn't seem to like the #if
> > > > !defined combined with a || operator on comparision directives.  This
> > > > construct seemed to work for me (but I'm not sure if it's optimal):
> > >
> > > Thanks, that looks right, I've put that in for the next release too.
> > >
> > > (#elif *is* better than #elseif too ;)
> >
> > That's what I was thinking and changed it to #elif after testing with
> > #elseif but then the compiler puked on that with exactly the same
> > message it did on the original construct.  That's got to be a compiler
> > bug, doesn't it?  Not that reporting it will help anytime soon...Is
> > #elseif less portable than #elif?
>
> Make sure it looks exactly like this:
>
> #if !defined(XML_MAJOR_VERSION)
> #define NEED_BOM_HANDLING
> #elif XML_MAJOR_VERSION < 2 && XML_MINOR_VERSION == 95 && XML_MICRO_VERSION < 
> 2
> #define NEED_BOM_HANDLING
> #endif
>
> if it doesn't work there is some other problem; what error does the
> compiler give?  There is really no such thing as an #elseif in CPP
> parlance (unless Microsoft invented one in which case it is
> MS-specific), there is only #elif.
>
> joe
>

I get one of these messages for each & character on the line (or lines
in the previous attempts):

src\ne_xml.c(52) : error C2018: unknown character '0x40'

and changing it to #elseif works.  It appears to not like the &&
operators in the standard #elif.  I guess it can be written with
nested #if's:

#if !defined(XML_MAJOR_VERSION)
  #define NEED_BOM_HANDLING
#eif XML_MAJOR_VERSION < 2
  #if XML_MINOR_VERSION == 95
    #if XML_MICRO_VERSION < 2
      #define NEED_BOM_HANDLING
    #endif
  #endif
#endif

seems to work for me.  Ugly, though. :(

DJ

_______________________________________________
neon mailing list
[email protected]
http://mailman.webdav.org/mailman/listinfo/neon

Reply via email to