Mail Archives: djgpp/1993/06/25/11:12:20
>> #error must define DOS_GETCWD or UNIX_GETCWD to select getcwd implementation
>> #endif
>Or better, instead of the #error, have the real getcwd() print an
>error message and exit. That way, you don't get the #error for
>programs that don't use getcwd at all.
Right, you should only get an error if getcwd is used. But the error should
come at compile time if possible since getcwd might only be used in an
obscure part of a program. It's easy enough to define getcwd as something
which generates a compiler error, but the error message should make it clear
what is happening. I'd like to say
#define getcwd(a,b) #error...
but I don't think that works. Maybe
#define getcwd(a,) (SELECT_ONE_OF | DOS_GETCWD | UNIX_GETCWD)
Here the error messages would be that SELECT_ONE_OF, DOS_GETCWD and
UNIX_GETCWD are not defined.
- Raw text -