non-gcc kjs/ build fixes
Adriaan de Groot
groot at kde.org
Fri Dec 7 19:04:40 GMT 2007
On Friday 07 December 2007, Harri Porten wrote:
> On Fri, 7 Dec 2007, Adriaan de Groot wrote:
> > I'd like to apply the following to get kjs/ to compile on non-gcc
> > platforms. The patches are similar to earlier fixes I put in, but given
>
> If possible I'd prefer adding a new internal function (ourMunmap()?) that
> has a well-defined API and does the #ifdef/casting ugliness in one place.
OK, I can do that.
> > using std::max;
> > +using std::memset;
>
> So there are systems that lack the C memset() function - or is it disabled
> by some switch?
GCC's headers automatically place std::memset() also in the global namespace,
so with GCC you do
#include <cstring>
memset(a,0,sizeof(a));
but not all sets of headers do (Sun Studio is the culprit here). This is the
smallest change to the code to get it to compile again.
> > +#if PLATFORM(SOLARIS_OS)
> > +#include <strings.h>
> > +#endif
>
> Just curious: what was this needed for?
str[n]casecmp(3) is in strings.h according to XPG 4.2; this only affects
really anal system headers (not on Linux or *BSD).
> P.S. kfm-devel might be a better list.
Recipients duly adjusted.
--
These are your friends - Adem
GPG: FEA2 A3FE Adriaan de Groot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071207/578e1af0/attachment.sig>
More information about the kde-core-devel
mailing list