[Issue 1722] std.math.nextafter: nextafterl does not exist on Windows

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 9 16:55:53 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1722





------- Comment #6 from wbaxter at gmail.com  2007-12-09 18:55 -------
(In reply to comment #5)
> I agree strongly with the compilation failure vs runtime error.  Problem,
> changing throw to static assert causes the build of phobos to fail, not user
> code. :)
> 
> I can change them to a template, such as:
> 
> real nextafter()(real x, real y)
> {
>     version (Windows)
>         static assert(false, "not implemented on windows");
>     else
>         return std.c.math.nextafterl(x, y);
> }
> 
> Templates get to live by more flexible erroring rules.  The problem is that
> it's only source compatible not link compatible with the previous,
> non-template, version of the function.  That's almost certainly acceptable for
> d2 at this stage of its life.
> 

What about static if'ing the whole thing (and the other functions like it) out
for non-Linux?  Or make it a template only for non-Linux

version(linux) {
 real nextafter(real x, real y)
 {
     return std.c.math.nextafterl(x, y);
 }   
} else {
 real nextafter()(real x, real y) {
    pragma(msg, "nextafter only implemented on Linux");
 }
}

If not that, then I guess just close it will-not-fix.


-- 



More information about the Digitalmars-d-bugs mailing list