[Python-Dev] if/else and macros

Barry Scott barry@scottb.demon.co.uk
Mon, 24 Jul 2000 21:38:15 +0100


> > > ! #define UTF8_ERROR(details) \
> > > !   if (1) {                                                  \
> > > !       if (utf8_decoding_error(&s, &p, errors, (details)))   \
> > > !           goto onError;                                     \
> > > !       continue;                                             \
> > > !   } else

Try defining the macro this way:

#define UTF8_ERROR(details) \
  do {                                                      \
      if (utf8_decoding_error(&s, &p, errors, (details)))   \
          goto onError;                                     \
      continue;                                             \
  } while(0)

	BArry