diff options
author | 2012-10-25 17:31:39 +0000 | |
---|---|---|
committer | 2012-10-25 17:31:39 +0000 | |
commit | 49a5b1967ac5bbc6699bee9a2c66088c42aef6fd (patch) | |
tree | 87bf79e0c8a59dc1c9834f59d1a54bcde014212e /include/core | |
parent | 6714ea4e4d96ad49c79ad51959db980141c56c38 (diff) |
add MACRO macros to help with concat. Stolen from gpu headers
git-svn-id: http://skia.googlecode.com/svn/trunk@6117 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkTypes.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h index d44c560412..ccb2767f76 100644 --- a/include/core/SkTypes.h +++ b/include/core/SkTypes.h @@ -123,6 +123,23 @@ struct SkCompileAssert { #define SK_COMPILE_ASSERT(expr, msg) \ typedef SkCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] +/* + * Usage: SK_MACRO_CONCAT(a, b) to construct the symbol ab + * + * SK_MACRO_CONCAT_IMPL_PRIV just exists to make this work. Do not use directly + * + */ +#define SK_MACRO_CONCAT(X, Y) SK_MACRO_CONCAT_IMPL_PRIV(X, Y) +#define SK_MACRO_CONCAT_IMPL_PRIV(X, Y) X ## Y + +/* + * Usage: SK_MACRO_APPEND_LINE(foo) to make foo123, where 123 is the current + * line number. Easy way to construct + * unique names for local functions or + * variables. + */ +#define SK_MACRO_APPEND_LINE(name) SK_MACRO_CONCAT(name, __LINE__) + /////////////////////////////////////////////////////////////////////// /** |