Re: [xslt] win32 trianon.c defines "const" as empty string



Tom Moog wrote:
> 
> Compiler MSVC 6 SP5
> 
> I'm not sure why, but trianon.c thinks that __STDC__
> is undefined.

Apparently because MSVC 6 SP5 does not define __STDC__

>                As a result, it redefines "const"
> and "volatile" as empty strings.  Aside from the
> fact that this is truly barbaric programming, it

I am often amazed at how little people appear know about standard
portability issues. The const and volatile keywords are additions
to ANSI C, and thus not present in K&R compilers. If the compiler
supports ANSI C, then it must define __STDC__. The re-definition
of const and volatile is not "truly barbaric", but a standard
portability trick to enable the use of the const and volatile
keywords with K&R compilers. See for example

  http://www.cs.umd.edu/users/cml/cstyle/portableC.html

> wouldn't cause problems, except that trianon.c
> is #included in xpath.c. The result is that all
> the const disappear in xpath.c.

Right, this is a problem. trionan.c, like most other C source
code files, has not been written with the intention of being
included in another C source code file.

I have committed a workaround to CVS. Thanks for the report.

> Forgot to mention that trianon is third party software.

What relevance does this statement have?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]