Manoah F. Adams - 2013-04-06

Manoah Adams <mhfadams@federaladamsfamily.com>
2013-04-07
Tiger (OS-X 10.4) G4 (PPC-7450) (powerpc-apple-darwin8-gcc-4.0.1)

Error:
'include/IL/devil_internal_exports.h' has special definition of ivec_align_buffer() for those of us with a PPC (AltiVec) system, but 'src-IL/src/il_alloc.c' does not have corresponding ALTIVEC_GCC adjustment.

Solution:
modified DevIL/Source/devil-1.7.8/src-IL/src/il_alloc.c
to account for ALTIVEC_GCC type conflict

This has not been tested operationally, but at least the build worked great.

=== original code in il_alloc.c ===

void *ivec_align_buffer(void *buffer, const ILsizei size)
{
if( (ILsizei)buffer % 16 != 0 ) {
        void *aligned_buffer = vec_malloc( size );
        memcpy( aligned_buffer, buffer, size );
        ifree( buffer );
        return aligned_buffer;
    }
    return buffer;
}
=== changed to … ===
#ifdef ALTIVEC_GCC
void *ivec_align_buffer(void *buffer, const ILuint size)
{
if( (ILuint)buffer % 16 != 0 ) {
        void *aligned_buffer = vec_malloc( size );
        memcpy( aligned_buffer, buffer, size );
        ifree( buffer );
        return aligned_buffer;
    }
    return buffer;
}
#else
void *ivec_align_buffer(void *buffer, const ILsizei size)
{
if( (ILsizei)buffer % 16 != 0 ) {
        void *aligned_buffer = vec_malloc( size );
        memcpy( aligned_buffer, buffer, size );
        ifree( buffer );
        return aligned_buffer;
    }
    return buffer;
}
#endif
=== end ===