Re: [AD] Patch to change the logfile name (4.3.10)

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


On Sunday 26 October 2008, Colin Ward wrote:
> On 24/10/2008, you wrote:
>
>
> [snip]
>
> >> So I added a #define in include/allegro/internal/aintern.h thus:
> >>
> >> #define ALLEGRO_LOGFILE_NAME "allegro.log"
> >>
> >> And changed src/allegro.c to use it.  So if a platform wants to change
> >> the log file name they can simply #undef and then re#define it in
> >> their platform specific header file (the one defined by
> >> ALLEGRO_INTERNAL_HEADER in the platform's *cfg.h file).
> >
> > I don't think it needs to be that complicated.  In src/allegro.c you
> > could just have:
> >
> >     #ifdef ALLEGRO_AMIGA
> >   #define LOGFILE "blahblah"
> >     #else
> >   #define LOGFILE "allegro.log"
> >     #endif
>
> Well I could do that, sure.  But I would have thought that you would want
> to reduce platform specific #ifdefs in generic code, or else you could end
> up with dozens of them.  My method is more complex but it keeps things more
> generic.

Usually the thought is don't generalize till two or more platforms need it.

> --
> /-------------------------------------------------------------------\
> [Hitman/Code HQ - 6502/z80/68000/604e/80x86/ARM coder - Amiga rulez!]
> [VZ-200/VIC-20/MZ-700/c16/c64*10/c128*8/Plus-4/CPC464/CD32/500*2    ]
> [600/1000/1200*2/A4000/SNES/N64/Dreamcast/Athlon 1100/AmigaOne      ]
> [Assembly Language: The most fun you can have with your clothes on! ]
> \-------------------------------------------------------------------/
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge Build the coolest Linux based applications with Moblin SDK & win
> great prizes Grand prize is a trip for two to an Open Source event anywhere
> in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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