From fbe9ecbdefae58a6ba0bb3f23a7a3d6c23ecfcf4 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Tue, 2 Feb 2010 22:34:14 +0000 Subject: [Author: dmaclach] Added GTM_NSSTRINGIFY_MACRO for turning other macros into NSStrings. R=thomasvl DELTA=10 (10 added, 0 deleted, 0 changed) --- GTMDefines.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'GTMDefines.h') 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 -- cgit v1.2.3