[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 3/3] gnu: Update ldc to 0.17.1.
From: |
Danny Milosavljevic |
Subject: |
Re: [PATCH v4 3/3] gnu: Update ldc to 0.17.1. |
Date: |
Tue, 13 Sep 2016 21:44:40 +0200 |
Sigh. Yeah, I've researched a bit why that happens.
The story is this:
glibc wanted to have isinf work with double AND float etc without conversion.
Therefore, there is a special gcc construct where you can find out what type a
parameter is IN A MACRO. Therefore, in C, isnan is a macro and so is isinf. The
include file defining it is <math.h>
However, in C++ there's a include file <cmath>. This one provides normal
functions in the namespace "std" (since overloads are possible in C++).
dmd2 undefs isinf which is why the C version doesn't work anymore (that's
stupid, really. What were they thinking?). But then they dont use the namespace
std so it won't use that one either. "::isinf" is DEFINITELY wrong - no idea
how that ever worked. It won't find the macro that way AND it won't find the
function in namespace std either (since <nothing>:: definitely says you want
the one without namespace).
Some LLVM versions include <cmath> somewhere in their header files - so dmd2 is
forced to use cmath rather than math.h even though they *want* to use math.h
and the source code says so.
Therefore, I now use the C++ std::isinf - I hope LLVM won't change their mind
again because then it will break again.
[PATCH v4 1/3] gnu: Add python-lit, python2-lit., Danny Milosavljevic, 2016/09/13
[PATCH v4 3/3] gnu: Update ldc to 0.17.1., Danny Milosavljevic, 2016/09/13