<br><br>On Friday, May 23, 2014, David Majnemer <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 23, 2014 at 11:30 AM, Justin Bogner <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','mail@justinbogner.com');" target="_blank">mail@justinbogner.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">David Majnemer <<a href="javascript:_e(%7B%7D,'cvml','david.majnemer@gmail.com');" target="_blank">david.majnemer@gmail.com</a>> writes:<br>
> [syserr.errcat.objects]p4 specifies that system_category<br>
> ().default_error_condition(ev) map to error_condition(posv, generic_category<br>
<div>> ()) if ev could map to a POSIX errno.<br>
><br>
> Linux reserves up to and including 4095 for errno values, use this as a bound.<br>
><br>
> This fixes syserr.errcat.objects/system_category.pass.cpp on Linux.<br>
<br>
</div>Would it be simpler to do something like<br>
<br>
#if !defined(ELAST) && defined(__linux__)<br>
#define ELAST 4095<br>
#endif<br>
<br>
at the top of the file and avoid having to change every #ifdef?<br></blockquote><div><br></div><div>I could do that if you wish but invading the POSIX namespace feels distasteful to me.</div></div></div></div></blockquote>
<div><br></div><div>Fair enough. It's fine as you have it.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
><br>
> diff --git a/src/ios.cpp b/src/ios.cpp<br>
> index 03af978..e241394 100644<br>
> --- a/src/ios.cpp<br>
> +++ b/src/ios.cpp<br>
> @@ -56,7 +56,9 @@ __iostream_category::message(int ev) const<br>
> if (ev != static_cast<int>(io_errc::stream)<br>
> #ifdef ELAST<br>
> && ev <= ELAST<br>
> -#endif<br>
> +#elif defined(__linux__)<br>
> + && ev <= 4095<br>
> +#endif // ELAST<br>
> )<br>
> return __do_message::message(ev);<br>
> return string("unspecified iostream_category error");<br>
> diff --git a/src/system_error.cpp b/src/system_error.cpp<br>
> index 00920ff..d5cb2d4 100644<br>
> --- a/src/system_error.cpp<br>
> +++ b/src/system_error.cpp<br>
> @@ -68,6 +68,9 @@ __generic_error_category::message(int ev) const<br>
> #ifdef ELAST<br>
> if (ev > ELAST)<br>
> return string("unspecified generic_category error");<br>
> +#elif defined(__linux__)<br>
> + if (ev > 4095)<br>
> + return string("unspecified generic_category error");<br>
> #endif // ELAST<br>
> return __do_message::message(ev);<br>
> }<br>
> @@ -100,6 +103,9 @@ __system_error_category::message(int ev) const<br>
> #ifdef ELAST<br>
> if (ev > ELAST)<br>
> return string("unspecified system_category error");<br>
> +#elif defined(__linux__)<br>
> + if (ev > 4095)<br>
> + return string("unspecified system_category error");<br>
> #endif // ELAST<br>
> return __do_message::message(ev);<br>
> }<br>
> @@ -110,6 +116,9 @@ __system_error_category::default_error_condition(int ev) const _NOEXCEPT<br>
> #ifdef ELAST<br>
> if (ev > ELAST)<br>
> return error_condition(ev, system_category());<br>
> +#elif defined(__linux__)<br>
> + if (ev > 4095)<br>
> + return error_condition(ev, system_category());<br>
> #endif // ELAST<br>
> return error_condition(ev, generic_category());<br>
> }<br>
> diff --git a/test/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp b/test/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp<br>
> index ddcb725..b5cb18a 100644<br>
> --- a/test/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp<br>
> +++ b/test/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp<br>
> @@ -23,7 +23,7 @@ int main()<br>
> std::error_condition e_cond = e_cat1.default_error_condition(5);<br>
> assert(e_cond.value() == 5);<br>
> assert(e_cond.category() == std::generic_category());<br>
> - e_cond = e_cat1.default_error_condition(500);<br>
> - assert(e_cond.value() == 500);<br>
> + e_cond = e_cat1.default_error_condition(5000);<br>
> + assert(e_cond.value() == 5000);<br>
> assert(e_cond.category() == std::system_category());<br>
> }<br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="javascript:_e(%7B%7D,'cvml','cfe-commits@cs.uiuc.edu');" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>
</blockquote>