Conditional compilation depending on sizeof(double) Is there a macro (#define ...) somewhere in the bowels of Arduino IDE or core header files which tells me at compile time(!), if the double data type for a given platform/board is a true double precision floating point number (64 bit width) or &quot;only&quot; an alias for a single precision float (32 bit width)?
With Arduino, both can be the case. 8-bit AVR boards have double equal to float, ARM-based boards (like Arduino Zero) support &quot;true&quot; double precision.
I am working on a library which implements some bit-banging of floating point numbers (both single and double precision). Due to the low-level nature of the problem, there must be separate functions for float and double. I would like to do somthing like that:
uint32_t function_for_float(float f) {
    // function body here...
}

#if defined(HAS_64_BIT_DOUBLE)
uint64_t function_for_double(double d) {
    // function body here...
}
#endif

That way, a compile time error would be generated if somebody tried to use the &quot;double&quot; version on platforms which do not support the &quot;true&quot; double data type. I want the compiler error to be generated, because function_for_double() will do silently &quot;the wrong thing&quot; when fed a single precision float, leading potentially to difficult-to-debug problems.
Right now, I am defining a macro constant for every relevant board I own, like this:
#if defined(ARDUINO_SAMD_ZERO) \
 || defined(SAMD_FEATHER_M0_EXPRESS) \
 || defined(ADAFRUIT_FEATHER_M4_EXPRESS)
    #define HAS_64_BIT_DOUBLE
#endif

But this is ugly and not future-proof (new boards can/will become available...).
Any suggestions?
The double data type is almost universally 8-bytes long, so you could
simply
#if !__AVR__
# define HAS_64_BIT_DOUBLE
#endif

Gcc provides a more specific macro though: __SIZEOF_DOUBLE__, which
has the same value as sizeof(double). But I do not know whether it is
provided by other compilers.