I'm developing some code which is expected to work in Arduino as well as Galileo, is there some specific way of detecting at compile time we are compiling for Galileo beyond those described at
? BTW, the one mentioned as INTEL_GALILEO in that thread did not work for me.
Have you tried with the architecture, as it is suggested in this thread /thread/58382?start=0&tstart=0 https://communities.intel.com/thread/58382?start=0&tstart=0? If that doesn't work, the thread author also suggests to use the PLATFORM_NAME or PLATFORM_IDE. However, as you mention in your post you already tried something similar to this (using the PLATFORM_NAME) so you can try with the first suggestion.
Well... the most convincing way of identifying platforms has been
# if !defined(ARDUINO_AVR_UNO)
// Galileo specific code here...
It's certainly limited, but so are my platform choices: Arduino Uno or Intel Galileo.