tjko / jpegoptim

jpegoptim - utility to optimize/compress JPEG files
http://www.iki.fi/tjko/projects.html
GNU General Public License v3.0
1.59k stars 117 forks source link

jpegoptim does not compile on Solaris 9 #23

Closed apptaro closed 9 years ago

apptaro commented 9 years ago

jpegoptim 1.4.2 does not compile on Solaris 9 with the following error:

Undefined first referenced symbol in file round jpegoptim.o

See: https://community.oracle.com/thread/1923824

Probably the code below should fix the issue:

ifndef HAVE_LIBM

define round(x) floor(0.5+x)

endif

apptaro commented 9 years ago

-lm is also needed for LIBS so floor can be used.

tjko commented 9 years ago

I don't think that macro really produces same results as real round() if x < 0. For example if x=-0.5 , round will return -1.0 but floor(0.5+(-0.5)) will return 0.0....

tjko commented 9 years ago

I updated code [see 87640bcbc9bad0c1c83e9141fab900b5ec76bf00] to use floor() instead of round(), so now it should compile fine on old Solaris?

apptaro commented 9 years ago

Thank you! Now it compiles on Solaris 9!