[gecode-users] making macros safe for semicolons
Denys Duchier
denys.duchier at univ-orleans.fr
Tue Dec 16 16:47:56 CET 2008
I had a couple of problems using some of Gecode macros because they
cannot all be safely followed by a semicolon. Here is a proposed patch
that uses de "do {...} while (0)" pattern to make these macros safe.
This is an old trick that is used a great deal in the Linux kernel.
The patch is against Gecode 2.2.0:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: macros-01.patch
Type: text/x-patch
Size: 3761 bytes
Desc: use do {...} while (0) pattern for macros
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081216/469431db/attachment.bin>
-------------- next part --------------
Cheers,
--Denys
More information about the gecode-users
mailing list