nxs_macro.h

00001 /*
00002  *  cpm_macro.h
00003  *  cpm
00004  *
00005  *  globally useful or interesting macros
00006  *  - this module is inherently thread-safe
00007  *
00008  *  Created by Justin Spahr-Summers on 8/2/07.
00009  *  Copyright 2007. All rights reserved.
00010  *
00011  */
00012 
00013 #ifndef CPM_HEADERS_MACRO
00014 #define CPM_HEADERS_MACRO
00015 
00016 // concatenates the fully expanded contents of 'a' and 'b'
00017 #define     CPM_MACRO_CONCAT(a, b) \
00018             CPM_MACRO_CONCAT_END_(a, b)
00019 
00020 // concatenates the fully expanded contents of 'a', 'b', and 'c'
00021 #define     CPM_MACRO_CONCAT3(a, b, c) \
00022             CPM_MACRO_CONCAT(CPM_MACRO_CONCAT (a, b      ), c)
00023 
00024 // concatenates the fully expanded contents of 'a', 'b', 'c', and 'd'
00025 #define     CPM_MACRO_CONCAT4(a, b, c, d) \
00026             CPM_MACRO_CONCAT(CPM_MACRO_CONCAT3(a, b, c   ), d)
00027 
00028 // concatenates the fully expanded contents of 'a', 'b', 'c', 'd', and 'e'
00029 #define     CPM_MACRO_CONCAT5(a, b, c, d, e) \
00030             CPM_MACRO_CONCAT(CPM_MACRO_CONCAT4(a, b, c, d), e)
00031 
00032 // makes a NUL-terminated string out of the fully expanded contents of 's'
00033 #define     CPM_MACRO_STRING(s) \
00034             CPM_MACRO_STRING_END_(s)
00035 
00036 /* INTERNAL USE ONLY */
00037 #define     CPM_MACRO_CONCAT_END_(a, b) a ## b
00038 
00039 #define     CPM_MACRO_STRING_END_(s) #s
00040 
00041 #endif

Generated on Thu Dec 20 13:42:46 2007 for NXS Toolkit by  doxygen 1.5.4