[Flac-dev] [PATCH] fix compile errors with asm disabled

Eric Wong eric at petta-tech.com
Fri Oct 1 17:50:49 PDT 2004


The #endifs are mismatched, and my builds were failing because
lpc_restore_signal* weren't getting declared.

I've also commented the endifs to make them easier to match.

Also, is there any reason #ifdefs for FLAC__HAS_NASM and FLAC__CPU_IA32 are
separate and nested the way they are and not combined like this?:

	#if defined(FLAC__CPU_IA32) && defined(FLAC__HAS_NASM)

I'm not sure if there are portability issues with the above, though.

--- orig/src/libFLAC/include/private/lpc.h
+++ mod/src/libFLAC/include/private/lpc.h
@@ -61,6 +61,7 @@
 void FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]);
 #endif
 #endif
+#endif
 
 /*
  *	FLAC__lpc_compute_lp_coefficients()
@@ -146,17 +147,16 @@
 void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]);
 void FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]);
 #ifndef FLAC__NO_ASM
-#ifdef FLAC__CPU_IA32
-#ifdef FLAC__HAS_NASM
+#  ifdef FLAC__CPU_IA32
+#    ifdef FLAC__HAS_NASM
 void FLAC__lpc_restore_signal_asm_ia32(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]);
 void FLAC__lpc_restore_signal_asm_ia32_mmx(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]);
-#endif
-#elif defined FLAC__CPU_PPC
+#    endif /* FLAC__HAS_NASM */
+#  elif defined FLAC__CPU_PPC
 void FLAC__lpc_restore_signal_asm_ppc_altivec_16(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]);
 void FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]);
-#endif
-#endif
-#endif
+#  endif /* FLAC__CPU_PPC || FLAC__CPU_IA32 */
+#endif /* FLAC__NO_ASM */
 
 /*
  *	FLAC__lpc_compute_expected_bits_per_residual_sample()

-- 
Eric Wong / normalperson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20041001/d636a31a/attachment.pgp


More information about the Flac-dev mailing list