[xmlsec] Little logic error
Aleksey Sanin
aleksey at aleksey.com
Mon Oct 21 08:08:54 PDT 2002
What about:
#if defined (__GNUC__) || (_MSC_VER >= 1300)
#define DUMMY
#else
#define __FUNCTION__ ""
#endif
Aleksey
Igor Zlatkovic wrote:
> Hi there,
>
> There is a small error of mine in include/xmlsec/errors.h regarding the
> __FUNCTION__ logic. The current predicate is
>
> #if !defined(__GNUC__) || (_MSC_VER >= 1300)
>
> which I wrongly assumed would work, on a gloomy day well past
> midnight. In
> fact, this predicate always fires on everything other than GNUC, because
> __GNUC__ is not defined.
>
> The truth is, that the correct predicate cannot be conducted
> generally, but
> every offending compiler must bring its own toys. That brings us to
> something like
>
> #if defined(__A_COMPILER__) && (__A_COMPILER__ < X)
> #define __FUNCTION__ ""
> #endif
>
> with "__A_COMPILER__" being whatever the current compiler predefines.
> Every
> compiler brand which does not support __FUNCTION__ will need its own
> construct like the above.
>
> I now fixed the predicate to handle the MSVC compiler version lower
> than 13.
> If there is someone using a compiler other than GNUC or MSVC, please
> drop me
> a correct predicate for your compiler, if it doesn't support the builtin
> __FUNCTION__ macro.
>
> Or does someone have a better idea?
>
> Ciao
> Igor
>
>
> _______________________________________________
> xmlsec mailing list
> xmlsec at aleksey.com
> http://www.aleksey.com/mailman/listinfo/xmlsec
More information about the xmlsec
mailing list