This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
Re: Building Eterm - please more help
- From: Benjamin Riefenstahl <Benjamin dot Riefenstahl at epost dot de>
- To: cygwin-xfree at cygwin dot com
- Date: 31 Oct 2002 17:06:56 +0100
- Subject: Re: Building Eterm - please more help
- References: <005d01c280e8$47522910$6501a8c0@sprymusic.com>
- Reply-to: cygwin-xfree at cygwin dot com
Hi Jean-Claude,
I wrote:
> >If PATH_MAX is not defined it defaults to 0 in preprocessor
> >conditionals. That's just the definition of the C language.
Jean-Claude Gervais <jc.gervais@videotron.ca> writes:
> What? Are you sure? I always thought the symbols was UNDEFINED, and
> not 0.
There is a special exception for preprocessor conditionals.
> If the symbol PATH_MAX is undefined, the following statement
>
> if ( PATH_MAX > 200 ) {
> }
>
> will get expanded by the pre-processor to
>
> if ( > 200 ) {
> }
If PATH_MAX is not defined during preprocessing, the preprocessor can
not know that it was supposed to be a preprocessor macro. So your
code above will be just unchanged by the preprocessor. After
preprocessing has been done, the actual C compiler will then complain
that PATH_MAX is an undefined variable or function.
There is the mentioned exception for preprocessor conditionals. If,
after macro replacement, they contain any left-over identifiers, those
are replaced with 0.
> BY THE WAY, why not use _MAX_PATH instead? It is commonly defined by
> all compiler vendors.
That's an MS invention, I believe, it certainly is not in the
standard. The standard macro for this feature is FILENAME_MAX,
defined in <stdio.h>.
so long, benny