working alignment check (but if alignment is needed it'll print out a 'Bus error' message which isn't nice...)

svn-id: r8270
This commit is contained in:
Max Horn 2003-06-02 11:20:07 +00:00
parent f8ab6ad8da
commit 2b1128acb5

19
configure vendored
View File

@ -307,13 +307,24 @@ case $endianess in
esac
rm -f tmp_endianess_check tmp_endianess_check.cpp
echo -n "Alignment required... "
#
# Check whether memory alignment is required
#
echo -n "Alignment required (don't worry if this shows a 'Bus error')... "
cat > $TMPC << EOF
#include <malloc.h>
int main (void) { (void) memalign(64, sizeof(char)); return 0; }
int main(int argc, char **argv)
{
int i;
unsigned char buf[20];
for (i = 0; i < 16; i++)
*(int *)(&buf[i]) = 0;
return 0;
}
EOF
_need_memalign=yes
cc_check && _need_memalign=no
# TODO: Hide the "Bus error" message, if possible...
trap true BUS
cc_check && ./$TMPO && _need_memalign=no
if test "$_need_memalign" = yes ; then
_def_align='#define SCUMM_NEED_ALIGNMENT'
else