[svn:parrot] r37019 - trunk/lib/Parrot/Pmc2c
cotto at svn.parrot.org
cotto at svn.parrot.org
Thu Feb 26 21:26:09 UTC 2009
Author: cotto
Date: Thu Feb 26 21:26:08 2009
New Revision: 37019
URL: https://trac.parrot.org/parrot/changeset/37019
Log:
[PMC2C] wrap GETATTR/SETATTR macros in a do{}while(0); instead of curly braces
Modified:
trunk/lib/Parrot/Pmc2c/Attribute.pm
Modified: trunk/lib/Parrot/Pmc2c/Attribute.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/Attribute.pm Thu Feb 26 19:48:24 2009 (r37018)
+++ trunk/lib/Parrot/Pmc2c/Attribute.pm Thu Feb 26 21:26:08 2009 (r37019)
@@ -109,7 +109,7 @@
/* Generated macro accessors for '$attrname' attribute of $pmcname PMC. */
#define GETATTR_${pmcname}_${attrname}(interp, pmc, dest) \\
- { \\
+ do { \\
if (PObj_is_object_TEST(pmc)) { \\
EOA
@@ -154,10 +154,10 @@
} \\
else \\
(dest) = ((Parrot_${pmcname}_attributes *)PMC_data(pmc))->$attrname; \\
- }
+ } while (0);
#define SETATTR_${pmcname}_${attrname}(interp, pmc, value) \\
- { \\
+ do { \\
if (PObj_is_object_TEST(pmc)) { \\
EOA
@@ -204,7 +204,7 @@
} \\
else \\
((Parrot_${pmcname}_attributes *)PMC_data(pmc))->$attrname = (value); \\
- }
+ } while (0);
EOA
More information about the parrot-commits
mailing list