
WITHLOCKEDSURFACE( screen,
rl->update(t);
gl->update(t);
bl->update(t);
);
Which is more readable than your example for me. The C macro might be less readable than your macro, I don''t know, as I havent gotten too far into lisp macros yet, and you didn''t show what your macro looked like

A similar C macro could look something like this:
(havent tested this actual code, so i might have done it wrong, but i know the macro could be done correctly if i spent a few minutes on it)
#define WITHLOCKEDSURFACE( screen, commands ) \if (SDL_MUSTLOCK(screen)) \{ \ if (-1 == SDL_LockSurface(screen)) \ { \ printf("Can''t lock hardware surface\n"); \ exit(1); \ } \} \commands;\if (SDL_MUSTLOCK(screen))\{ \ SDL_UnlockSurface(screen);\}
Or one could simply forget about macros and use functions:
Lock( screen );rl->update(t);gl->update(t);bl->update(t);Unlock( screen );
Which is still just as readable as your code, and the only area that makes it more bug prone is that a person could forget to unlock.
Peace