From 3d1776273507b31be0401a435de4a5721fc3e2b5 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Mon, 14 Jan 2008 09:22:22 +0000 Subject: [PATCH] Added a macro for concatenation of two strings, which may be macro expansions --- core/sys/cc.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/sys/cc.h b/core/sys/cc.h index c35bdad3f..1d1c8bdde 100644 --- a/core/sys/cc.h +++ b/core/sys/cc.h @@ -39,7 +39,7 @@ * * This file is part of the Contiki desktop OS * - * $Id: cc.h,v 1.4 2007/11/18 01:37:48 oliverschmidt Exp $ + * $Id: cc.h,v 1.5 2008/01/14 09:22:22 adamdunkels Exp $ * */ #ifndef __CC_H__ @@ -117,4 +117,15 @@ #ifndef NULL #define NULL 0 #endif /* NULL */ + +#define CC_CONCAT2(s1, s2) s1##s2 +/** + * A C preprocessing macro for concatenating to + * strings. + * + * We need use two macros (CC_CONCAT and CC_CONCAT2) in order to allow + * concatenation of two #defined macros. + */ +#define CC_CONCAT(s1, s2) CC_CONCAT2(s1, s2) + #endif /* __CC_H__ */