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) --- BuildScripts/PListCompiler.sh | 2 +- GTMDefines.h | 8 ++++++++ ReleaseNotes.txt | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/BuildScripts/PListCompiler.sh b/BuildScripts/PListCompiler.sh index 2bc9c57..f3ca6cb 100755 --- a/BuildScripts/PListCompiler.sh +++ b/BuildScripts/PListCompiler.sh @@ -58,4 +58,4 @@ done IFS=$SaveIFS # run gcc and strip out lines starting with # that the preprocessor leaves behind. -eval gcc ${split_include_paths} -E -x c "${SCRIPT_INPUT_FILE}" | sed 's/^#.*//g' > "${SCRIPT_OUTPUT_FILE}" \ No newline at end of file +eval gcc ${split_include_paths} -E -x c "${SCRIPT_INPUT_FILE}" | sed 's/^#.*//g' > "${SCRIPT_OUTPUT_FILE}" 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 diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index d0f2506..4f0b6b8 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -394,6 +394,8 @@ Changes since 1.5.1 - Added PListCompiler.sh for compiling plists. +- Added GTM_NSSTRINGIFY_MACRO for turning other macros into NSStrings. + Release 1.5.1 Changes since 1.5.0 -- cgit v1.2.3