Opened 7 years ago

Closed 6 years ago

#42735 closed defect (fixed)

swftools: error: use of undeclared identifier 'TRUE' with jpeg @9a_0

Reported by: gregoryhansell@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: ryandesign (Ryan Schmidt)
Port: swftools

Description

Downloaded Macports today for the first time and was able to do other installs successfully.

Tried to port SWFTools but failed.

Did a clean on this port, same errors.

Thanks for any help you could give me! I looked around through Search and FAQ and couldn't work this out myself. Thank you again!

Error log attached.

Attachments (1)

swffail2.log (375.0 KB) - added by gregoryhansell@… 7 years ago.

Download all attachments as: .zip

Change History (10)

Changed 7 years ago by gregoryhansell@…

Attachment: swffail2.log added

comment:1 Changed 7 years ago by mf2k (Frank Schima)

Port: swftools added; SWFTools removed

comment:2 Changed 7 years ago by ryandesign (Ryan Schmidt)

Cc: ryandesign@… added
Summary: SWFTools install failure on Mac OS 10.9.2swftools: error: use of undeclared identifier 'TRUE' with jpeg @9a_0

The log has many errors along these lines:

:info:build jpeg.c:109:35: error: use of undeclared identifier 'TRUE'
:info:build   jpeg_set_quality(&cinfo,quality,TRUE);
:info:build                                   ^

See also #42710 for a different jpeg boolean problem reported against digikam. Both are probably because I removed the boolean patch from the jpeg port when updating it to version 9a recently, assuming upstream's different changes had solved the problem a different way, but which turn out not to have solved the problem, so I need to bring back the patch.

comment:3 Changed 7 years ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: newclosed

Fixed in r117626.

comment:4 in reply to:  3 Changed 7 years ago by gregoryhansell@…

Replying to ryandesign@…:

Fixed in r117626.

The build is still failing for me, even after doing a clean on swftools. Is there a dependency that needs to be cleaned or uninstalled?

comment:5 Changed 7 years ago by gregoryhansell@…

Resolution: fixed
Status: closedreopened

comment:6 Changed 7 years ago by ryandesign (Ryan Schmidt)

Did you run "sudo port selfupdate", "sudo port upgrade outdated" and "sudo port clean swftools" before trying again? If not, please do.

comment:7 in reply to:  6 Changed 7 years ago by gregoryhansell@…

Replying to ryandesign@…:

Did you run "sudo port selfupdate", "sudo port upgrade outdated" and "sudo port clean swftools" before trying again? If not, please do.

I did and that worked, thank you!

comment:8 in reply to:  3 ; Changed 7 years ago by ryandesign (Ryan Schmidt)

Replying to ryandesign@…:

Fixed in r117626.

A developer of jpeg says jpeg 9a is correct, and swftools is in error. So in the future I will remove this patch from jpeg, and swftools should be changed instead:

From: Guido Vollbeding <guido@jpegclub.org>
Subject: Re: Build failures with jpeg 9a
Date: March 6, 2014 at 07:07:17 CST
To: Ryan Schmidt <ryandesign@macports.org>

Dear Ryan

Thank you for feedback.

In version 9 we changed to a more reliable definition of the 'boolean'
type (in file jmorecfg.h).
This may cause conflicts with applications which do not comply with the
specified application programming interface (the digikam issue is such
a case).
In other cases, it may be necessary to use the HAVE_BOOLEAN mechanism,
if application insists on using their own type.
We have improved the situation in 9a, but some cases remain which can
only be fixed in application code.

Our suggestion is that software developers be notified to correct or
adapt their programs appropriately.
I have done this with the libjpeg maintainer of the Debian Linux
distribution, in which course we went through a batch of cases which
were affected by the issue, and I offered respective solutions.
Your cases were part of the batch:

digikam:
If "true" is a variable of int type, then using an explicit typecast
"(boolean)true" fixes the issue.
If "true" means a constant of some other bool type, then using TRUE
instead fixes the issue.
The libjpeg API specifies the type "boolean" here with values TRUE
or FALSE, and everything else is an error and always was.

swftools-0.9.2 defines following:

 lib/jpeg.c:

 #ifdef HAVE_JPEGLIB
 #define HAVE_BOOLEAN
 #include <jpeglib.h>

The interpretation of HAVE_BOOLEAN has been changed in new library,
which now means that both the type AND the corresponding values are
defined, which is more general and consistent.
Modifying the place where boolean is defined or changing at this place to

 #ifdef HAVE_JPEGLIB
 #ifndef FALSE            /* in case these macros already exist */
 #define FALSE   0        /* values of boolean */
 #endif
 #ifndef TRUE
 #define TRUE    1
 #endif
 #define HAVE_BOOLEAN
 #include <jpeglib.h>

should make it work with either version of libjpeg.

Any other issues should be variations of these and could be resolved
similarly.  If you have particular problem please let me know and I
will look at it.

Regards
Guido Vollbeding
Organizer Independent JPEG Group

comment:9 in reply to:  8 Changed 6 years ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: reopenedclosed

Replying to ryandesign@…:

swftools should be changed instead:

r123209

Note: See TracTickets for help on using tickets.