On 2022-10-22 11:11, janezz55 wrote:
I tried to use std::trunc(), but it doesn't work and browsing through header files revealed gcc does not trust the math.h header file DJGPP provides and so does not declare it. trunc(), truncf(), truncl() work as expected though.
the error is:
error: 'trunc' is not a member of 'std'; did you mean 'trunc'? /usr/i586-pc-msdosdjgpp/include/math.h:195:15: note: 'trunc' declared here
195 | extern double trunc(double);
apparently the macro __CORRECT_ISO_CPP11_MATH_H_PROTO_FP is not defined. Defining it explicitly produces errors related to isnan().
Documentation about the macro says: Define if all C++11 floating point overloads are available in <math.h>.
For some reason this message never showed up in my mailbox, I only just
see it now on NNTP.
The issue is that djgpp does not implement all C99 math functions, so
libstdc++ just disables all of them. You can of course use ::trunc()
from libc or __builtin_trunc() (with f/l suffix where appropriate).
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)