Re: [AD] alconfig.h errors

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


> I've reported this several times, but as I recently upgraded from 4.1.5 to
> 4.1.9 I was hoping it had been fixed but it had not.  alconfig compiles
> with warnings, because it assumes that the size of a long is equal to the
> size of an unsigned char*.

Yes, sizeof(long) == sizeof(void *) is a reasonable assumption, even on 
64-bit platforms. MSVC doesn't agree though.

> I am using MSVC.NET 2002, I don't have MSVC 2003, but I figure the same
> results would occur.  I do the following in my programs to prevent this
> from happening every time I include allegro.h:
>
> #pragma warning( push )
> #pragma warning( disable : 4312 )
> #include <allegro.h>
> #pragma warning( pop )
>
> I suppose this would not be an easy fix since it seems to be a way that
> Allegro was designed.

I don't think the fix is that difficult: simply define a macro

	AL_INTPTR_T

equal to 'intptr_t' if it is available or 'long' if it is not. Do the same 
for

	AL_INTPTRDIFF_T

and do the replacement. IMHO this shouldn't really break the library on 
64-bit platforms if it is not already broken.

> I couldn't fix the warnings without changing the Allegro interface, so
> there may not be an easy way.

Would there be many functions of the API to fix?

-- 
Eric Botcazou




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