Bug 14582 - Build issue: USE_EXCEPTIONS definition is set or queried incorrectly
Summary: Build issue: USE_EXCEPTIONS definition is set or queried incorrectly
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: low minor
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-20 04:16 UTC by Moritz Barsnick
Modified: 2008-02-21 11:46 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
patch for proper use of USE_EXCEPTIONS (1.86 KB, patch)
2008-02-20 04:16 UTC, Moritz Barsnick
Details | Splinter Review

Description Moritz Barsnick 2008-02-20 04:16:11 UTC
Created attachment 14447 [details] [review]
patch for proper use of USE_EXCEPTIONS

When compiling poppler with the configure option "--enable-exceptions" and with gcc-4.2, it becomes obvious that the USE_EXCEPTIONS definition isn't used correctly.

In goo/gmem.cc and goo/gmem.h, the definition is queried with "#if USE_EXCEPTIONS". Yet it is defined with "#define USE_EXCEPTIONS", which is boolean, and expands to an empty string. Therefore "#if USE_EXCEPTIONS" is an expression which cannot be evaluated. (The C preprocessor sees "#if ".)

The solutions might be:
- Replace "#if USE_EXCEPTIONS" with "#ifdef USE_EXCEPTIONS".
- Replace "#define USE_EXCEPTIONS" with "#define USE_EXCEPTIONS 1".

Since I suppose the latter isn't the regular case with autoconf, I propose the former solution. A patch is attached, which works for me.

The patch is against poppler-0.6.2, but it applies cleanly and safely against newer versions, including 0.7.0.
Comment 1 Albert Astals Cid 2008-02-21 11:46:38 UTC
Fixed it using making configure define USE_EXCEPTIONS to 1, it is a way smaller patch and we are following that convention anywhere else too.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.