Fix compilation with clang #4228

Closed
wants to merge 2 commits into
from

Projects

None yet

4 participants

@LordAro
LordAro commented Mar 4, 2014

At least, clang 3.4, on Arch Linux

Otherwise it errors with __float128 errors, and there's also a "register keyword is deprecated" error fix in there too

"Fixes" #4227

@LordAro LordAro Fix compilation with clang
At least, clang 3.4, on Arch Linux
ac12084
@LordAro LordAro referenced this pull request Mar 4, 2014
Open

Building with clang #4227

@hatstand
Collaborator
hatstand commented Mar 4, 2014

Out of curiosity, does using libc++/libstdc++ make a difference?

@LordAro
LordAro commented Mar 4, 2014

(Without my patch)
Using -stdlib=libc++ instead of the STRICT_ANSI changes, the __float128 error seems to be removed, but the register error (which required the -Wno-deprecated-register addition) still happens

@hatstand
Collaborator
hatstand commented Mar 6, 2014

This breaks compilation on ubuntu precise with gcc:

clementine/3rdparty/chromaprint/src/avresample/resample2.c:115:17: error: ‘M_PI’ undeclared (first use in this function)
@LordAro
LordAro commented Mar 6, 2014

I can't reproduce this
Nor can do I have the necessary libraries to need to compile chromaprint - which do i need?

@LordAro
LordAro commented Mar 6, 2014

Also, M_PI was dropped in C99 - i'm reasonably certain i haven't changed the standards of the C files

That said, i did have trouble with isfinite, so i've amended (locally) a -std setting for moodbar

@LordAro LordAro Fix compilation with clang
At least, clang 3.4, on Arch Linux
b27f77a
@LordAro
LordAro commented Mar 19, 2014

Bump?

@davidsansome
Member

To build 3rdparty/chromaprint you actually need to not have libchromaprint installed - it's only compiled if the system library isn't found.

FWIW, I get the same error:

3rdparty/chromaprint/src/avresample/resample2.c:115:17: error: ‘M_PI’ undeclared (first use in this function)
@jorgicio
jorgicio commented May 3, 2016 edited

My 20 cents:
I found a workaround on LLVM bugtrack, then created a patch and applied into the CMakelists.txt in the root of the source code. Using Clang 3.5.0 and Clementine 1.3.1 and working.

https://bugs.gentoo.org/attachment.cgi?id=433122&action=diff

@hatstand hatstand closed this May 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment