lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: [lmi] Unit test for C99 round()


From: Vadim Zeitlin
Subject: Re[2]: [lmi] Unit test for C99 round()
Date: Thu, 5 Jun 2008 14:15:55 +0200

On Thu, 05 Jun 2008 01:25:02 +0000 Greg Chicares <address@hidden> wrote:

GC> >    http://lists.nongnu.org/archive/html/lmi/2008-02/msg00026.html
[keeping the URL for the context]
GC> On 2008-02-11 18:40Z, Vaclav Slavik wrote:
GC> |
GC> | What do you think about it, should I [try to] do it like this?
GC> 
GC> Yes, please.

 Ok, thanks, either Vaclav or me will try to do it like this then.

GC> Here's a rough sketch of a solution:
GC> 
GC>      if(0 == safe_message_alert_function)
GC>          {
GC> -        throw std::runtime_error
GC> +        safely_report_catastrophe
GC>              ("No function defined for reporting a problem safely."
GC>              );
GC>          }
GC> 
GC> ...with an implementation like...
GC> 
GC> void safely_report_catastrophe(char const* p)
GC> {
GC> #if defined LMI_POSIX
GC>     fputs(p, stderr);
GC>     fputs('\n', stderr);
GC>     fflush(stderr);
GC> #elif defined LMI_MSW
GC>     ::MessageBox(...I forget the "safest" way...);
GC> #else // Unknown platform.
GC> #   error Unknown platform. Consider contributing support.
GC> #endif // Unknown platform.
GC> }
GC> 
GC> What do you think?

 This is exactly what I'd like to see, so I have no comments about this and
would be glad to see this change committed.

 Thanks!
VZ





reply via email to

[Prev in Thread] Current Thread [Next in Thread]