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

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


Hi.

On 26/10/2008, you wrote:
> 
>> > 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.

I've been away for a month but finally got back in front of my computer to
do some work again.  :-)  A month or more ago I submitted a patach to
change the logfile name but it was deemed to be too complex.  Here is the
simplified one as suggested.

-- 
/-------------------------------------------------------------------\
[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! ]
\-------------------------------------------------------------------/
Index: src/allegro.c
===================================================================
--- src/allegro.c	(revision 11144)
+++ src/allegro.c	(working copy)
@@ -29,6 +29,11 @@
 #define PREFIX_W                "al-main WARNING: "
 #define PREFIX_E                "al-main ERROR: "
 
+#ifdef ALLEGRO_AMIGA
+   #define LOGFILE "RAM:allegro.log"
+#else
+   #define LOGFILE "allegro.log"
+#endif
 
 
 /* in case you want to report version numbers */
@@ -640,7 +645,7 @@
       if (s)
 	 trace_file = fopen(s, "w");
       else
-	 trace_file = fopen("allegro.log", "w");
+	 trace_file = fopen(LOGFILE, "w");
 
       if (debug_assert_virgin)
 	 _add_exit_func(debug_exit, "debug_exit");


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