I understand using the NETFX_CORE directive, like this:
#if NETFX_CORE
// Windows 8
#else
// Windows Phone 8
#endif
More info: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj714084(v=vs.105).aspx
But is there a directive specific to Windows Phone 8?