Summary: | fails to compile - kpixmapcache.cpp: argument is being passed void* | ||
---|---|---|---|
Product: | [Unmaintained] kdelibs | Reporter: | tropikhajma <tropikhajma> |
Component: | kdeui | Assignee: | kdelibs bugs <kdelibs-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mpyne, yselkowi |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Solaris | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | POSIX_MADV_WILLNEED patch |
Description
tropikhajma
2009-06-04 22:37:04 UTC
> this is on opensolaris 2009.06/x86_32
You'd think they'd have fixed madvise() by now. The first parameter should be void*, not char* (or caddr_t), both by POSIX and the original BSD implementation.
Is this something we should have in kdefakes? I don't like the idea of #ifdef'ing it here. Alternatively, it there a configure flag we can add for Solaris to get more POSIX-ish #includes?
the sys/mman.h on opensolaris defines posix_madvise, which is probably what is needed: #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__) extern int posix_madvise(void *, size_t, int); #endif SVN commit 979086 by mpyne: Fix compilation errors on Solaris for good by using a different function that does the exact same thing but has a different name, except this time the interface is defined properly. Or in other words s/madvise/posix_madvise/ Configure checks have also been updated. Not backporting to 4.2, but will be in KDE 4.3. BUG:195262 M +3 -3 ConfigureChecks.cmake M +3 -7 kdecore/sycoca/ksycoca.cpp M +2 -2 kdeui/util/kpixmapcache.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=979086 tropikhajma: I said "for good" in the commit log but I'm not sure if we need to add any defines to the command line to actually get access to posix_madvise -- please reopen if it still doesn't compile (preferably with a patch containing the appropriate Sun magic incantation to get POSIX support). Created attachment 37754 [details] POSIX_MADV_WILLNEED patch According to POSIX.1-2008[1], you also need to s/MADV_WILLNEED/POSIX_MADV_WILLNEED/ to those two source files. This is necessary to compile on Cygwin (where the first is not supported but the latter is). Patch against 4.3.2 attached. [1] http://www.opengroup.org/onlinepubs/9699919799/functions/posix_madvise.html SVN commit 1039881 by mpyne: Fix a compile error with posix_madvise noted on Cygwin by yselkowitz, who also provided the patch. This is for KDE 4.4, will backport to KDE 4.3.3. CCBUG:195262 M +1 -1 kdecore/sycoca/ksycoca.cpp M +1 -1 kdeui/util/kpixmapcache.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1039881 SVN commit 1039910 by mpyne: Backport compile fix for Cygwin usage of posix_madvise to KDE 4.3.3. Note: This code was wrong but happened to work on non-Cygwin, this is not a Cygwin-specific change. Patch provided, and issue reported by yselkowitz. CCBUG:195262 M +1 -1 kdecore/sycoca/ksycoca.cpp M +1 -1 kdeui/util/kpixmapcache.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1039910 |