Mon, 06 Aug 2007
Okay, so one night I was complaining about the Pascal compiler, and I complained that macros didn't work. To my embarrassment and pleasure, I found that's not true. They work on CW Pro 4; I just wasn't using them correctly.
For the record, here's my (working) assertion macros:
{$IFC APH_DEBUG}
{$definec Assert(assertion) begin if not (assertion) then
DebugStr('assertion failed;hc;sc') end}
{$definec AssertStr(assertion, str) begin if not (assertion) then
DebugStr(str + ';hc;sc') end}
{$ELSEC}
{$definec Assert(assertion)}
{$definec AssertStr(assertion, str)}
{$ENDC}
I stumbled across an example of doing it correctly inside some Apple sample code, in the MoreSetup.p file of the MoreIsBetter package, still available at http://developer.apple.com.
posted at: 21:51 | path: /geek/hpc | permanent link to this entry

