[AD] clear() problem and BeOS

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


I have a patch to apply on the BeOS port that fixes a nasty bug that only 
occurs on SMP machines, but yesterday, when I was testing the lib, I 
discovered there's a problem with clear() again... The lib does compile nicely 
and all the shipped programs/examples work out of the box, but when I tried 
linking the lib to another program (anyone not shipped with Allegro), I got 
many "undefined reference to 'clear'"...
This was puzzling to me as the shipped Allegro programs all compiled and 
worked, so I examined the problem and did a lot of tests, just to discover the 
problem disappears if you change the clear() declaration into alinline.h this 
way:

[...]
    #if (defined ALLEGRO_GCC)
-      extern inline void clear(BITMAP *bmp) { clear_bitmap(bmp); }
+      AL_INLINE(void, clear, (BITMAP *bmp), { clear_bitmap(bmp); })
[...]

With this change applied, everything works (shipped programs and non), but 
it's still puzzling to me... ALLEGRO_GCC is defined on BeOS, so alconfig.h 
should automatically #define AL_INLINE(x) as "extern inline x"; why using 
AL_INLINE works and the explicit form doesn't? In any case, do you agree if 
apply the patch?

--
Angelo Mottola
a.mottola@xxxxxxxxxx
http://www.ecplusplus.com 



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