My app is compatible with iOS5 and iOS6. Until now I had no problem using:
NSString DeviceID = [[UIDevice currentDevice] uniqueIdentifier];
As hard replacement of static macro, you can try dynamic if statement to check it.
UIDevice has property named 'systemVersion' and you can check this.