Re: RFA: Support Windows extended error numbers in safe_strerror

Eli Zaretskii
2006-02-04T10:24:29Z

> Date: Fri, 3 Feb 2006 22:00:25 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Mark Kettenis <mark.kettenis@xs4all.nl>, gdb-patches@sourceware.org
>
> > If we had safe_strerror try a macro which the nm-*.h file could
> > define, I'd feel better about the change.
>
> Except we're trying to kill the aggravating NM files, remember? Also,
> it would be an XM file, and we've already successfully killed those (or
> most of them). We replaced them with autoconf magic, which is not
> fundamentally different from the USE_WIN32API bits.

Right.

But we still can separate system-specific code from system-independent
one. One way is to have a function which is only defined on systems
which need it. Something like this:

#ifdef NEED_FOOBAR
foobar ();
#endif

with the body of `foobar' hiding all the rest on a Windows-specific
source file. I think such a method minimizes the bad impact of
ifdef's and does not annoy too much when one reads the sources.