log2 problems
i've noticed that log2 with newlib as an issue.
If you try this simple program
#include <cmath>
#include <iostream>
int main() {
std::cout << std::log2(10) << std::endl;
return 0;
}
And try to compile it you will have this error:
In file included from /usr/ppc-amigaos/include/c++/8.3.0/cmath:45,
from log2.c:1:
log2.c: In function 'int main()':
log2.c:5:20: error: expected unqualified-id before '(' token
std::cout << std::log2(10) << std::endl;
^~~~
This because log2 into newlib (in math.h) that is called from cmath:45 is defined as a macro so std::seems not work
#define log2(x) (log (x) / M_LOG2_E)
Do you have a quick workaround for this?
Try transforming the macro into an inline.
Is anyone was able to deal with ? I currently hit the same issue.
The fastest solution i've found is to add using namespace std; and then remove std:: and it works
from newlib's side everything about "not a member of std::" was fixed in the new beta of newlib 53.69 and adtools recompiled with new newlib's headers.