Summary: | KMail from kdepim-3.2.0-alpha2 fails to compile on Solaris | ||
---|---|---|---|
Product: | [Applications] kmail | Reporter: | Torsten Kasch <tk> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Solaris | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | patch for kdepim/kmail/kmmsgbase.cpp |
Description
Torsten Kasch
2003-09-30 14:03:34 UTC
Created attachment 2648 [details]
patch for kdepim/kmail/kmmsgbase.cpp
According to swab(2) (if you neglect the obvious mistake in there ;-) there are
two variants of the swab() function:
SYNOPSIS
Default
#include <stdlib.h>
void swab(const void *src, char *dest, ssize_t nbytes);
XPG4, SUS, SUSv2
#include <unistd.h>
void swab(const void *src, void *dest, ssize_t nbytes);
The latter one is only available when _XOPEN_SOURCE is #defined and if
_XOPEN_VERSION - 0 >= 4. Since I'm not sure about the implications of defining
these symbols, the attached patch introduces an appropriate cast for the first
one (which takes "char *" as arguments).
Subject: kdepim/kmail CVS commit by mutz: Fix Solaris compile errors reported and patched by Torsten Kasch <tk (at ) Genetik (dot) uni-bielefeld (dot) de> CCMAIL: 65234-done@bugs.kde.org, 65232-done@bugs.kde.org M +3 -3 kmfolderindex.cpp 1.11 M +1 -1 kmmsgbase.cpp 1.160 --- kdepim/kmail/kmfolderindex.cpp #1.10:1.11 @@ -371,5 +371,5 @@ bool KMFolderIndex::updateIndexStreamPtr if(just_close) { if(mIndexStreamPtr) - munmap(mIndexStreamPtr, mIndexStreamPtrLength); + munmap((char *)mIndexStreamPtr, mIndexStreamPtrLength); mIndexStreamPtr = 0; mIndexStreamPtrLength = 0; @@ -381,5 +381,5 @@ bool KMFolderIndex::updateIndexStreamPtr if(fstat(fileno(mIndexStream), &stat_buf) == -1) { if(mIndexStreamPtr) - munmap(mIndexStreamPtr, mIndexStreamPtrLength); + munmap((char *)mIndexStreamPtr, mIndexStreamPtrLength); mIndexStreamPtr = 0; mIndexStreamPtrLength = 0; @@ -387,5 +387,5 @@ bool KMFolderIndex::updateIndexStreamPtr } if(mIndexStreamPtr) - munmap(mIndexStreamPtr, mIndexStreamPtrLength); + munmap((char *)mIndexStreamPtr, mIndexStreamPtrLength); mIndexStreamPtrLength = stat_buf.st_size; mIndexStreamPtr = (uchar *)mmap(0, mIndexStreamPtrLength, PROT_READ, MAP_SHARED, --- kdepim/kmail/kmmsgbase.cpp #1.159:1.160 @@ -1145,5 +1145,5 @@ off_t KMMsgBase::getLongPart(MsgPartType #ifndef WORDS_BIGENDIAN // We need to use swab to swap bytes to network byte order -#define memcpy_networkorder(to, from, len) swab(from, to, len) +#define memcpy_networkorder(to, from, len) swab((char *)(from), (char *)(to), len) #else // We're already in network byte order |