Summary: | poppler/CairoFontEngine.cc fails to build due to munmap() | ||
---|---|---|---|
Product: | poppler | Reporter: | Darren Kenny <darren.kenny> |
Component: | general | Assignee: | poppler-bugs <poppler-bugs> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Solaris | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Patch to fix compilation issue.
Try again with #ifdefs... |
Description
Darren Kenny
2009-04-07 01:44:43 UTC
My munmap man page says int munmap(void *addr, size_t length); And sun docs agree http://docs.sun.com:80/app/docs/doc/816-5167/munmap-2?a=view Hmm, it would appear that the definition changes depending on some #defines... From /usr/include/sys/mman.h: #if (_POSIX_C_SOURCE > 2) || defined(_XPG4_2) ... extern int munmap(void *, size_t); ... #else /* (_POSIX_C_SOURCE > 2) || defined(_XPG4_2) */ ... extern int munmap(caddr_t, size_t); ... It looks like for C++ these macros are not defined since they conflict with the ANSI C++ standards - from standards manpage: ANSI/ISO C++ ANSI/ISO C++ does not define any feature test macros. If the standard C++ announcement macro __cplusplus is predefined to value 199711 or greater, the compiler operates in a standard-conforming mode, indicating C++ standards confor- mance. The value 199711 indicates conformance to ISO/IEC 14882:1998, as required by that standard. (As noted above, conformance to the standard is incomplete.) A standard- conforming mode is not available with compilers prior to Sun WorkShop C++ 5.0. C++ bindings are not defined for POSIX or X/Open CAE, so specifying feature test macros such as _POSIX_SOURCE, _POSIX_C_SOURCE, and _XOPEN_SOURCE can result in compilation errors due to conflicting requirements of standard C++ and those specifications. It would appear to not be a bug after all, I just need to figure out the correct definitions for Solaris. Apologies, closing as not a bug. Created attachment 24664 [details] [review] Try again with #ifdefs... I've changed my mind, this is still an issue - since defining any of the "standards" macros causes more serious breakages else where. As a compromise, I've put a specific #ifdef test around the munmap call to meet the Sun Compiler's settings, so it should have no effect else where. Reopening since no mix of #defs allows all of poppler to compile cleanly. It makes more sense to fix specifically for the Sun Compiler. Carlos, what you think of this? if data->bytes is an unsigned char * and munmap expects a char * why not just adding the cast without any defines? Because of comment #1 hmm, then we should use (void *) instead of (char *), no? But it seems some Solaris version and some Solaris compiler doesn't like void* strange. Well, if the patch fixes the problem and doesn't break any other compilers/platforms, it's ok to me. Fixed in git |
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.