Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#62199 closed defect (fixed)

mathgl @2.4.4_4: /export.cpp:187:30: error: use of undeclared identifier 'TRUE'

Reported by: kencu (Ken) Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: mathgl

Description

mathgl is not rebuilding after the recent change to libjpeg-turbo:

:info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_mathgl/mathgl/work/mathgl-2.4.4/src && /opt/local/bin/clang++-mp-9.0 -DMGL_HAVE_GSL2 -DMGL_SRC -DNO_COLOR_ARRAY -Dmgl_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_mathgl/mathgl/work/mathgl-2.4.4/include -I/opt/local/include -F//System/Library/Frameworks -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_mathgl/mathgl/work/mathgl-2.4.4/src/prc -pipe -Os -stdlib=libc++ -DNDEBUG -arch x86_64 -mmacosx-version-min=10.6 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -o CMakeFiles/mgl.dir/fit.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_mathgl/mathgl/work/mathgl-2.4.4/src/fit.cpp
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_mathgl/mathgl/work/mathgl-2.4.4/src/export.cpp:187:30: error: use of undeclared identifier 'TRUE'
:info:build         jpeg_start_compress(&cinfo, TRUE);
:info:build                                     ^

this is on 10.6.8, building with clang-5.0 or clang-9.0, which may or may not be relevant.

Attachments (1)

mathgl-fail-clang9-snowleopard.log (117.3 KB) - added by kencu (Ken) 4 years ago.

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by kencu (Ken)

comment:1 Changed 4 years ago by kencu (Ken)

well, it seems to go to trouble to make sure TRUE is undefined, before using it later...

#if MGL_HAVE_GIF
#include <gif_lib.h>
#undef TRUE
#undef FALSE
#endif

That seems weird.

and at other places, it doesn't like to use TRUE but seems ok to use true:

void MGL_EXPORT mgl_write_png(HMGL gr, const char *fname,const char *)
{
	long w,h;	unsigned char *f=0, **p=0;
	p =_Gr_->GetRGBLines(w,h,f,true);
	if(p)

this all smells like something rather hackish...

comment:2 Changed 4 years ago by Schamschula (Marius Schamschula)

It sure does look like a hack! Let me see if this happens on a newer version of macOS.

comment:3 Changed 4 years ago by Schamschula (Marius Schamschula)

I get the same error on Mojave.

comment:4 Changed 4 years ago by Schamschula (Marius Schamschula)

It looks like I had a patch file to deal with jpeg, which is no longer needed with libjpeg-turbo. No need to rev bump, as mathgl shouldn't have built correctly for any OS version after the change to libjpeg-turbo.

comment:5 Changed 4 years ago by Schamschula (Marius Schamschula)

Resolution: fixed
Status: assignedclosed

In 8ec4acf0c8f0c38be971523a4f621778d0571d6a/macports-ports (master):

mathgl: remove patch obsoleted by libjpeg-turbo

Closes: #62199

comment:6 Changed 4 years ago by kencu (Ken)

thanks!

Note: See TracTickets for help on using tickets.