diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-02-02 22:34:14 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-02-02 22:34:14 +0000 |
commit | fbe9ecbdefae58a6ba0bb3f23a7a3d6c23ecfcf4 (patch) | |
tree | c9911906c7e25c337ae72556f0f809c2c1b7a18b /GTMDefines.h | |
parent | b7c220eef1c55426c5a7c003c4890a5b2ed97e2b (diff) |
[Author: dmaclach]
Added GTM_NSSTRINGIFY_MACRO for turning other macros into NSStrings.
R=thomasvl
DELTA=10 (10 added, 0 deleted, 0 changed)
Diffstat (limited to 'GTMDefines.h')
-rw-r--r-- | GTMDefines.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/GTMDefines.h b/GTMDefines.h index 3c69547..65693ea 100644 --- a/GTMDefines.h +++ b/GTMDefines.h @@ -145,6 +145,14 @@ GTM_EXTERN void _GTMUnitTestDevLog(NSString *format, ...); typedef char _GTMCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ] #endif // _GTMCompileAssert +// Macro to allow you to create NSStrings out of other macros. +// #define FOO foo +// NSString *fooString = GTM_NSSTRINGIFY(FOO); +#if !defined (GTM_NSSTRINGIFY) + #define GTM_NSSTRINGIFY_INNER(x) @#x + #define GTM_NSSTRINGIFY(x) GTM_NSSTRINGIFY_INNER(x) +#endif + // Macro to allow fast enumeration when building for 10.5 or later, and // reliance on NSEnumerator for 10.4. Remember, NSDictionary w/ FastEnumeration // does keys, so pick the right thing, nothing is done on the FastEnumeration |