Created
August 24, 2011 10:33
-
-
Save monkeydom/1167744 to your computer and use it in GitHub Desktop.
Objective-C Compare Macro for your convenience
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if !defined(COMPARE) | |
#define COMPARE(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? NSOrderedAscending : (__a > __b ? NSOrderedDescending : NSOrderedSame); }) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment