[SDL] reRE: [OT] RE: [SDL] Windows version...

Mattias Engdegård f91-men at nada.kth.se
Wed Aug 8 06:53:00 PDT 2001

"Mark Collins" <m.collins at codeplay.com> wrote:
>extern DECLSPEC <function> (Not ANSI)

No, DECLSPEC is defined in begin_code.h

>#define SOMETHING(blah)
>case 0: do { blah
>case 3: blah
>case 2: blah
>case 1: } while (blah)

That is legal C (assuming you add a switch() of course), and has been
so since the K&R (pre-C89) days, when Tom Duff came up with his device
(in 1983 I believe).

>That implementation is on shakey ground. The ANSI C specification is very
>vague when it comes to loops in that context. It *is* illegal in C++ to do
>it that way.

No, ISO C (and ANSI for that matter) is very clear about it, nothing shaky
there. See section of the latest C standard (ISO/IEC 9899/1999)
Whether it's illegal in C++ is irrelevant since SDL is written in C,
but I think it's legal in C++ as well. If you can quote the parts of
the C++ standard where it says it's illegal, do so.

More information about the SDL mailing list