From f746bbbef6134ea00dc5cd875391e64adcaf277c Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Wed, 31 Jan 2007 04:20:05 +0000 Subject: [PATCH] amd64 fixes --- ChangeLog | 4 ++++ configure.ac | 12 ++++++++++++ iff/iff.c | 14 +++++++------- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c45e5d5..eafd0dde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-01-30 Bradley Bell + + * configure.ac, iff/iff.c: amd64 fixes + 2006-12-16 Chris Taylor * arch/carbon/conf.h: allow universal binaries to be built using diff --git a/configure.ac b/configure.ac index a7552f4e..174d79f2 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,7 @@ AC_PROG_CXX AC_STDC_HEADERS AC_PATH_PROGS(NASM, nasm nasmw, no) AC_C_BIGENDIAN +AC_CHECK_SIZEOF(void *) case $host_cpu in sparc) @@ -145,6 +146,10 @@ if test x$enable_fastfileio != xno; then AC_MSG_WARN([big-endian cpu detected. disabling fastfileio]) enable_fastfileio="no"; fi + if test $ac_cv_sizeof_void_p != 4; then + AC_MSG_WARN([pointers not 32 bits. disabling fastfileio]) + enable_fastfileio="no"; + fi fi if test x$enable_fastfileio != xno; then AC_DEFINE(FAST_FILE_IO,,[Define for faster i/o on little-endian cpus]) @@ -168,6 +173,7 @@ if test "x$sharepath" = "xauto" -o "x$sharepath" = "xyes" -o "x$sharepath" = "x" fi AC_SUBST(sharepath) eval sharepath=$sharepath +eval sharepath=$sharepath AC_DEFINE_UNQUOTED(SHAREPATH, "$sharepath",[Define this to be the shared game directory root]) # Test for MSDOS @@ -346,6 +352,12 @@ if test x$enable_assembler != xno; then enable_assembler="no" ;; esac + case $host_cpu in + x86_64) + AC_MSG_WARN([nasm not supported for this cpu. disabling assembler]) + enable_assembler="no" + ;; + esac fi fi if test x$enable_assembler = xno; then diff --git a/iff/iff.c b/iff/iff.c index 90905023..8272d8a7 100644 --- a/iff/iff.c +++ b/iff/iff.c @@ -1,4 +1,4 @@ -/* $Id: iff.c,v 1.10 2004-12-01 06:57:28 btb Exp $ */ +/* $Id: iff.c,v 1.11 2007-01-31 04:20:05 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -23,7 +23,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: iff.c,v 1.10 2004-12-01 06:57:28 btb Exp $"; +static char rcsid[] = "$Id: iff.c,v 1.11 2007-01-31 04:20:05 btb Exp $"; #endif #define COMPRESS 1 //do the RLE or not? (for debugging mostly) @@ -86,7 +86,7 @@ typedef struct fake_file { int length; } FFILE; -#define MAKE_SIG(a,b,c,d) (((long)(a)<<24)+((long)(b)<<16)+((c)<<8)+(d)) +#define MAKE_SIG(a,b,c,d) (((int32_t)(a)<<24)+((int32_t)(b)<<16)+((c)<<8)+(d)) #define form_sig MAKE_SIG('F','O','R','M') #define ilbm_sig MAKE_SIG('I','L','B','M') @@ -100,7 +100,7 @@ typedef struct fake_file { #define dlta_sig MAKE_SIG('D','L','T','A') #ifndef NDEBUG -//void printsig(long s) +//void printsig(int32_t s) //{ // char *t=(char *) &s; // @@ -109,7 +109,7 @@ typedef struct fake_file { //} #endif -long get_sig(FFILE *f) +int32_t get_sig(FFILE *f) { char s[4]; @@ -138,10 +138,10 @@ long get_sig(FFILE *f) s[3] = f->data[f->position++]; #endif - return(*((long *) s)); + return(*((int32_t *) s)); } -int put_sig(long sig,FILE *f) +int put_sig(int32_t sig,FILE *f) { char *s = (char *) &sig; -- 2.39.2