RFA: Support Windows extended error numbers in safe_strerror

Eli Zaretskii eliz@gnu.org
Thu Feb 9 20:40:00 GMT 2006


> Date: Thu, 9 Feb 2006 09:57:53 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org
> 
> Of course there's a flip side.  If I do it Eli's way, the default
> version has to compile and link.  Which happens to be the case for
> the two examples we have today, but also a pretty limiting assumption.

If the default version doesn't compile on the platform that needs the
hook, the solution is simple: define enough macros and stub functions
to effectively make it the default version a nop on that platform.

But in practice, the need for this rarely if ever arises.  Macros and
global symbols that are highly unportable tend to be used only if
defined, as in:

    #if defined (TIOCGWINSZ)
      if (ioctl (tty, TIOCGWINSZ, &window_size) == 0)
	{
	  _rl_screenwidth = (int) window_size.ws_col;
	  _rl_screenheight = (int) window_size.ws_row;
	}
    #endif /* TIOCGWINSZ */



More information about the Gdb-patches mailing list