Re: Flac build issue in debug win x32

Olivier Tristan <[email protected]>
Newsgroups gmane.comp.audio.compression.flac.devel
Message-ID <[email protected]>
Here is a patch that fixes the issue.

There are multiple way to fix it though.


Le 14/02/2017 à 15:08, Olivier Tristan a écrit :
> Hi Guys,
>
> The following code in CPU.c (line 155) won't link if you don't have 
> NASM code built even if FLAC__HAS_X86INTRIN is true as 
> FLAC__cpu_info_asm_ia32 don't exists and the else is compiled if there 
> is no dead code stripping
>
> if (FLAC__HAS_X86INTRIN) {
>         FLAC__cpu_info_x86(0, &flags_eax, &flags_ebx, &flags_ecx, 
> &flags_edx);
>         info->ia32.intel = (flags_ebx == 0x756E6547 && flags_edx == 
> 0x49656E69 && flags_ecx == 0x6C65746E) ? true : false; /* GenuineIntel */
>         FLAC__cpu_info_x86(1, &flags_eax, &flags_ebx, &flags_ecx, 
> &flags_edx);
>     }
>     else {
>         FLAC__cpu_info_asm_ia32(&flags_edx, &flags_ecx);
>     }
>
>
> Maybe it should be an ifdef instead of an if ?
>
> Thanks !
>

-- 
Olivier Tristan
Research & Development
www.uvi.net

_______________________________________________
flac-dev mailing list
[email protected]
http://lists.xiph.org/mailman/listinfo/flac-dev
cpu.c.patch (text/plain, 500 B)
 src/libFLAC/cpu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libFLAC/cpu.c b/src/libFLAC/cpu.c
index 5f86809..4bad89c 100644
--- a/src/libFLAC/cpu.c
+++ b/src/libFLAC/cpu.c
@@ -118,7 +118,9 @@ ia32_cpu_info (FLAC__CPUInfo *info)
 		FLAC__cpu_info_x86(1, &flags_eax, &flags_ebx, &flags_ecx, &flags_edx);
 	}
 	else {
+#if FLAC__HAS_NASM
 		FLAC__cpu_info_asm_ia32(&flags_edx, &flags_ecx);
+#endif
 	}
 
 	info->ia32.cmov  = (flags_edx & FLAC__CPUINFO_IA32_CPUID_CMOV ) ? true : false;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.