summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2006-09-09 18:29:12 +0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-09-11 08:56:21 +0000
commit1ccb7c8d11bf6f3b795893f8ec88106e161747d5 (patch)
treeff1a44b7dba118c37bda9e36a9d2e27a5a63a050 /perlio.c
parentddfa59c744ee4cca9b8e77d5034cfbacac89bcda (diff)
downloadperl-1ccb7c8d11bf6f3b795893f8ec88106e161747d5.tar.gz
C++: Solaris CC now compiles "perl"
Message-ID: <4502B398.6060505@iki.fi> p4raw-id: //depot/perl@28814
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c9
1 files changed, 8 insertions, 1 deletions
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;