Using _Decimal64 from g++

I am mixing and matching C/C++ in a single project. Whilst gcc recognises _Decimal64 as a built-in type, g++ does not. Is there a way that I can cajole g++ into recognising it, and "doing the right thing"?

NB I cannot used the C++ std::decimal type, as that would introduce incompatabilities with C interoperability.
The other direction might be easier. If you put wrappers around the functions that need it, you could convert from this to doubles in the C code and call it with doubles from C++, maybe?

The libstdc++ documentation for std::decimal::decimal64 mentions __decfloat64, which looks like it could be a built-in type. You could try that.

https://gcc.gnu.org/onlinedocs/gcc-4.6.2/libstdc++/api/a00460.html
Thanks guys. It looks like helios is right. __decfloat64 in C++ is the equivalent of _Decimal64 in (gnu) C. Phew.

I've written an example gist
https://gist.github.com/blippy/139fb0f2dff8703b6eae8129509d0d14
for those that want the gory details of how C and C++ can co-exist.
Last edited on
Nice, I didn't catch that these were OS specific defines, sorry.
Topic archived. No new replies allowed.