Exactly that (or the nicer looking #if defined(PARTICLE)
)
In addition to that you can drill down via PRODUCT_ID and other “secondary” defines like Wiring_WiFi, Wiring_Cellular (defined in spark_wiring_platform.h )
Or you use the HW specific defines like STM32F2XX (in that thread SPARK is mentioned which still works but was superceded by PARTICLE)