How to detect Genuino 101 from inside the code?
Arduino defines some macros so you can use conditional compilation. For example these are from boards.txt:


use ARDUINO_AVR_PROMICRO if it's specific for board variant
use ARDUINO_ARCH_AVR if it's specific for Arduino with AVR


Also avr-gcc defines macros according to cpu settings (this should be similar for other platforms too):


use __AVR_ATmega32U4__ if it's specific for only one MCU
use __AVR__ if it's compatible with all AVR based MCUs


And code examples:

#if defined(__AVR_ATmega88__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__)
// something for ATmegaXX8 family...
#else
// ...
#endif

#ifdef __AVR__ 
// Code related to AVR
#else
// Code for other architectures
#endif


More about predefined macros in avr-gcc.