Fake __FUNCTION__ for non-gcc builds, cast madvise()
authorJarkko Hietaniemi <jhi@iki.fi>
Sun, 5 Nov 2000 21:28:39 +0000 (21:28 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 5 Nov 2000 21:28:39 +0000 (21:28 +0000)
first argument correctly.

p4raw-id: //depot/perl@7567

perlio.c

index 55c6ad3..f225f03 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -100,6 +100,9 @@ PerlIO_init(void)
 
 #undef printf
 void PerlIO_debug(char *fmt,...) __attribute__((format(printf,1,2)));
+#ifndef __GNUC__
+#define __FUNCTION__ "PerlIO_debug"
+#endif
 
 void
 PerlIO_debug(char *fmt,...)
@@ -1827,7 +1830,7 @@ PerlIOMmap_map(PerlIO *f)
        if (b->buf && b->buf != (STDCHAR *) -1)
         {
 #if defined(HAS_MADVISE) && defined(MADV_SEQUENTIAL)
-         madvise(b->buf, len, MADV_SEQUENTIAL);
+         madvise((Mmap_t)b->buf, len, MADV_SEQUENTIAL);
 #endif
          PerlIOBase(f)->flags = flags | PERLIO_F_RDBUF;
          b->end = b->buf+len;