Re: Problem With Macros

xxxxx@hht.satyam.com said:

There is a macro “errno” in stddef.h which is a standard include file
provided with microsoft. The problem comes when I want to define my
own version of “errno”.

Two things:

First, errno is an ANSI standard thingy. A compiler is allowed to provide
it as a macro, but need not, and often does not. What you are attempting
to do is highly non-portable.

Second, there is simply nothing you can do about all the other DLLs and
libraries that are already compiled with the definition of errno that
you see.

xxxxx@india.hp.com said:

First errno is not a macro, its a variable.

Not always. ANSI-C does not say yes or now. It is typical for errno to
be a variable, but it is often a macro (that calls a function) in
multi-threaded environments. All that ANSI-C says is that it must be
a valid l-value.