Re: [AD] Proposed END_OF_MAIN documentation.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Tuesday 01 April 2003 5:29 am, Eric Botcazou wrote:
> > +@@Macro @END_OF_MAIN();
> > +@xref Windows specifics, Unix specifics, Differences between platforms
> > +@xref exhello
> > +   In order to maintain cross-platform compatibility, you have to put
> > this +   macro at the very end of your main function. This macro uses
> > some `magic' +   to mangle your main procedure under platforms
>
> ... on platforms...
>
> > which need it like Windows

I prefer 'that' instead of 'which'. Use 'which' when the preceding noun would 
make sense by itself. Use 'that' when the clause it introduces is an integral 
part of the meaning of the noun. (This is the reason why MS Word suggests 
using a comma before 'which' but not before 'that', if anyone wondered.)

> > +   or Linux. In the other platforms this macro compiles to
>
> On the other platforms...
>
> > nothing, so you +   don't have to #ifdef it around. Example:

"#ifdef around it".

> >
> > +<codeblock>
> > +      int main(void)
> > +      {
> > +	 allegro_init();
> > +	 /* here some more stuff */

Nitpicky, but /* more stuff goes here */ or just /* stuff goes here */ :)

> > +	 ...
> > +	 return 0;
> > +      }
> > +      END_OF_MAIN();
> > +<endblock>
>
> No semi-colon after END_OF_MAIN().

AFAIK, the docs don't actually say whether the semicolon should be included. I 
always put it in, on this and other macros, because it looks more consistent 
with function calls. The compiler certainly accepts it. Note also the 
following quote from the docs:

      void my_timer_handler()
      {
         counter++;
      }

      END_OF_FUNCTION(my_timer_handler);

I agree it would be a good idea to document whether one should put a semicolon 
after these macros, to encourage consistency if nothing else. Personally I'd 
prefer to put the semicolons in, but I already said that ;)

Ben




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/