From 1ccb7c8d11bf6f3b795893f8ec88106e161747d5 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Sat, 9 Sep 2006 18:29:12 +0300 Subject: C++: Solaris CC now compiles "perl" Message-ID: <4502B398.6060505@iki.fi> p4raw-id: //depot/perl@28814 --- perlio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'perlio.c') diff --git a/perlio.c b/perlio.c index b6dca82fb1..8f6947faf0 100644 --- a/perlio.c +++ b/perlio.c @@ -4593,7 +4593,14 @@ PerlIOMmap_unmap(pTHX_ PerlIO *f) if (m->len) { PerlIOBuf * const b = &m->base; if (b->buf) { - code = munmap(m->mptr, m->len); + /* The munmap address argument is tricky: depending on the + * standard it is either "void *" or "caddr_t" (which is + * usually "char *" (signed or unsigned). If we cast it + * to "void *", those that have it caddr_t and an uptight + * C++ compiler, will freak out. But casting it as char* + * should work. Maybe. (Using Mmap_t figured out by + * Configure doesn't always work, apparently.) */ + code = munmap((char*)m->mptr, m->len); b->buf = NULL; m->len = 0; m->mptr = NULL; -- cgit v1.2.1