From: Kentaro F. <fu...@me...> - 2006-12-26 20:12:34
|
Hello Cyril, > Today i tried to compile effectv on my slackware 11.0 and it failed : > > gcc -DUSE_NASM -DUSE_MMX -DUSE_VLOOPBACK -DVLOOPBACK_VERSION=91 -DDEFA > DEVICE=\""/dev/video0"\" -DI686 -march=pentiumpro -O3 -fomit-frame-poi > oll-loops -Iv4lutils `sdl-config --cflags` -Wall -c -o utils.o utils.c > utils.c:30: error: conflicting types for 'trunc' > utils.c:30: error: conflicting types for 'trunc' > make[1]: *** [utils.o] Error 1 > make[1]: Leaving directory `/home/sx/src/effectv-0.3.11' > make: *** [all-recursive] Error 2 This compile-time bus was introduced by recent glibc and gcc, who had its own "trunc()" function. A better way to avoid this bug is renaming them to, say "itrunc()". A patch follows. Thanks, Kentaro Fukuchi. Index: utils.c =================================================================== --- utils.c (revision 492) +++ utils.c (working copy) @@ -26,7 +26,7 @@ /* * HSI color system utilities */ -static int trunc(double f) +static int itrunc(double f) { int i; @@ -44,9 +44,9 @@ Gv=1+S*sin(H); Bv=1+S*sin(H+2*M_PI/3); T=255.999*I/2; - *r=trunc(Rv*T); - *g=trunc(Gv*T); - *b=trunc(Bv*T); + *r=itrunc(Rv*T); + *g=itrunc(Gv*T); + *b=itrunc(Bv*T); } /* |