[Assorted-commits] SF.net SVN: assorted: [677] sandbox/trunk/src/c/macros.c
Brought to you by:
yangzhang
|
From: <yan...@us...> - 2008-04-23 20:41:17
|
Revision: 677
http://assorted.svn.sourceforge.net/assorted/?rev=677&view=rev
Author: yangzhang
Date: 2008-04-23 13:41:17 -0700 (Wed, 23 Apr 2008)
Log Message:
-----------
commas in macros
Modified Paths:
--------------
sandbox/trunk/src/c/macros.c
Modified: sandbox/trunk/src/c/macros.c
===================================================================
--- sandbox/trunk/src/c/macros.c 2008-04-23 20:40:48 UTC (rev 676)
+++ sandbox/trunk/src/c/macros.c 2008-04-23 20:41:17 UTC (rev 677)
@@ -5,6 +5,7 @@
#define greet(x) printf("hello, " #x "!\n")
#define rename(x) x##_val_##x
+#define decl(x) int x;
// GCC extensions.
@@ -20,6 +21,10 @@
x_val_x = 0;
printf("%d\n", x_val_x);
+ // decl(alpha,beta,gamma); // This won't work.
+#define comma ,
+ decl(alpha comma beta comma gamma); // This works.
+
char a = 'A';
dup(a,b);
b += 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|