Preprocessor to detect hardware features? 64-bit double, memory size, etc

I’ve got some code that I’d like to selectively compile, depending on the features of the board the user is using:

A. 32-bit double + low RAM (e.g., Uno) - low precision
B. 32-bit double + high RAM (e.g., Mega) - library emulating 64-bit double math
C. 64-bit double (ESP8266, ARM M0) - native high precision

ideally I’d like to detect features rather than a list of specific boards/CPUs. e.g.,

#if sizeof(double) == 8
#if program_memory >= 8*1024
...
#else
...
#endif
#else
...
#endif

are there suitable preprocessor #defines that I could use? or will I need a long list of specific boards/CPUs like:

#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)  ....

Many thanks

http://www.nongnu.org/avr-libc/user-manual/group__avr__io.html

I think this should do the trick?

#if !defined(DOUBLE_TYPE_SIZE) || DOUBLE_TYPE_SIZE == 32
#if FLASHEND > 0x8000
 // 32-bit double + high RAM (e.g., Mega)
#else
 // 32-bit double + low RAM (e.g., Uno) 
#endif
#else
 // 64-bit double (ESP8266, ARM M0) 
#endif

sheffieldnick: I think this should do the trick?

"Last address" not "memory size". The name does correspond. ;)