diff --git a/configure.ac b/configure.ac index 46cb916b..993ac336 100644 --- a/configure.ac +++ b/configure.ac @@ -269,6 +269,15 @@ AC_ARG_ENABLE(werror, AC_ARG_ENABLE(stack-smash-protection, AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection])) +AC_ARG_ENABLE(64-bit-words, + AC_HELP_STRING([--enable-64-bit-words], [Set FLAC__BYTES_PER_WORD to 8 (4 is the default)])) +if test "x$enable_64_bit_words" = xyes ; then + AC_DEFINE_UNQUOTED([ENABLE_64_BIT_WORDS],1,[Set FLAC__BYTES_PER_WORD to 8 (4 is the default)]) +else + AC_DEFINE_UNQUOTED([ENABLE_64_BIT_WORDS],0) + fi +AC_SUBST(ENABLE_64_BIT_WORDS) + AC_ARG_ENABLE(valgrind-testing, AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]), [case "${enableval}" in diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c index 3559bf12..813c0631 100644 --- a/src/libFLAC/bitreader.c +++ b/src/libFLAC/bitreader.c @@ -49,7 +49,7 @@ /* WATCHOUT: there are a few places where the code will not work unless brword is >= 32 bits wide */ /* also, some sections currently only have fast versions for 4 or 8 bytes per word */ -#if 1 +#if (ENABLE_64_BIT_WORDS == 0) typedef FLAC__uint32 brword; #define FLAC__BYTES_PER_WORD 4 /* sizeof brword */ diff --git a/src/libFLAC/bitwriter.c b/src/libFLAC/bitwriter.c index 742fba36..bc4717e4 100644 --- a/src/libFLAC/bitwriter.c +++ b/src/libFLAC/bitwriter.c @@ -48,7 +48,7 @@ /* WATCHOUT: if you change this you must also change the following #defines down to SWAP_BE_WORD_TO_HOST below to match */ /* WATCHOUT: there are a few places where the code will not work unless bwword is >= 32 bits wide */ -#if 1 +#if (ENABLE_64_BIT_WORDS == 0) typedef FLAC__uint32 bwword; #define FLAC__BYTES_PER_WORD 4 /* sizeof bwword */ diff --git a/src/test_libFLAC/bitwriter.c b/src/test_libFLAC/bitwriter.c index d8f744c9..303c1373 100644 --- a/src/test_libFLAC/bitwriter.c +++ b/src/test_libFLAC/bitwriter.c @@ -33,7 +33,7 @@ * the definition here to get at the internals. Make sure this is kept up * to date with what is in ../libFLAC/bitwriter.c */ -#if 1 +#if (ENABLE_64_BIT_WORDS == 0) typedef FLAC__uint32 bwword; #define FLAC__BYTES_PER_WORD 4