summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/util.c b/util.c
index a5cd95419d..8962fff609 100644
--- a/util.c
+++ b/util.c
@@ -16,6 +16,7 @@
#define PERL_IN_UTIL_C
#include "perl.h"
+#ifndef PERL_MICRO
#if !defined(NSIG) || defined(M_UNIX) || defined(M_XENIX)
#include <signal.h>
#endif
@@ -23,6 +24,7 @@
#ifndef SIG_ERR
# define SIG_ERR ((Sighandler_t) -1)
#endif
+#endif
/* XXX If this causes problems, set i_unistd=undef in the hint file. */
#ifdef I_UNISTD
@@ -87,7 +89,7 @@ Perl_safesysmalloc(MEM_SIZE size)
if ((long)size < 0)
Perl_croak_nocontext("panic: malloc");
#endif
- ptr = PerlMem_malloc(size?size:1); /* malloc(0) is NASTY on our system */
+ ptr = (Malloc_t)PerlMem_malloc(size?size:1); /* malloc(0) is NASTY on our system */
PERL_ALLOC_CHECK(ptr);
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) malloc %ld bytes\n",PTR2UV(ptr),(long)PL_an++,(long)size));
if (ptr != Nullch)
@@ -131,7 +133,7 @@ Perl_safesysrealloc(Malloc_t where,MEM_SIZE size)
if ((long)size < 0)
Perl_croak_nocontext("panic: realloc");
#endif
- ptr = PerlMem_realloc(where,size);
+ ptr = (Malloc_t)PerlMem_realloc(where,size);
PERL_ALLOC_CHECK(ptr);
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) rfree\n",PTR2UV(where),(long)PL_an++));
@@ -184,7 +186,7 @@ Perl_safesyscalloc(MEM_SIZE count, MEM_SIZE size)
Perl_croak_nocontext("panic: calloc");
#endif
size *= count;
- ptr = PerlMem_malloc(size?size:1); /* malloc(0) is NASTY on our system */
+ ptr = (Malloc_t)PerlMem_malloc(size?size:1); /* malloc(0) is NASTY on our system */
PERL_ALLOC_CHECK(ptr);
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) calloc %ld x %ld bytes\n",PTR2UV(ptr),(long)PL_an++,(long)count,(long)size));
if (ptr != Nullch) {
@@ -1000,7 +1002,8 @@ Perl_fbm_instr(pTHX_ unsigned char *big, register unsigned char *bigend, SV *lit
if ( SvTAIL(littlestr)
&& (bigend - big == littlelen - 1)
&& (littlelen == 1
- || (*big == *little && memEQ(big, little, littlelen - 1))))
+ || (*big == *little &&
+ memEQ((char *)big, (char *)little, littlelen - 1))))
return (char*)big;
return Nullch;
}
@@ -1168,7 +1171,8 @@ Perl_fbm_instr(pTHX_ unsigned char *big, register unsigned char *bigend, SV *lit
}
check_end:
if ( s == bigend && (table[-1] & FBMcf_TAIL)
- && memEQ(bigend - littlelen, oldlittle - littlelen, littlelen) )
+ && memEQ((char *)(bigend - littlelen),
+ (char *)(oldlittle - littlelen), littlelen) )
return (char*)bigend - littlelen;
return Nullch;
}
@@ -1283,7 +1287,8 @@ Perl_screaminstr(pTHX_ SV *bigstr, SV *littlestr, I32 start_shift, I32 end_shift
return (char*)big;
big -= stop_pos;
if (*big == first
- && ((stop_pos == 1) || memEQ(big + 1, little, stop_pos - 1)))
+ && ((stop_pos == 1) ||
+ memEQ((char *)(big + 1), (char *)little, stop_pos - 1)))
return (char*)big;
return Nullch;
}
@@ -2491,7 +2496,7 @@ dup2(int oldfd, int newfd)
}
#endif
-
+#ifndef PERL_MICRO
#ifdef HAS_SIGACTION
Sighandler_t
@@ -2594,6 +2599,7 @@ Perl_rsignal_restore(pTHX_ int signo, Sigsave_t *save)
}
#endif /* !HAS_SIGACTION */
+#endif /* !PERL_MICRO */
/* VMS' my_pclose() is in VMS.c; same with OS/2 */
#if (!defined(DOSISH) || defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(__OPEN_VM) && !defined(EPOC) && !defined(MACOS_TRADITIONAL)
@@ -2635,15 +2641,19 @@ Perl_my_pclose(pTHX_ PerlIO *ptr)
#ifdef UTS
if(PerlProc_kill(pid, 0) < 0) { return(pid); } /* HOM 12/23/91 */
#endif
+#ifndef PERL_MICRO
rsignal_save(SIGHUP, SIG_IGN, &hstat);
rsignal_save(SIGINT, SIG_IGN, &istat);
rsignal_save(SIGQUIT, SIG_IGN, &qstat);
+#endif
do {
pid2 = wait4pid(pid, &status, 0);
} while (pid2 == -1 && errno == EINTR);
+#ifndef PERL_MICRO
rsignal_restore(SIGHUP, &hstat);
rsignal_restore(SIGINT, &istat);
rsignal_restore(SIGQUIT, &qstat);
+#endif
if (close_failed) {
SETERRNO(saved_errno, saved_vaxc_errno);
return -1;
@@ -3661,7 +3671,7 @@ Perl_get_opargs(pTHX)
PPADDR_t*
Perl_get_ppaddr(pTHX)
{
- return &PL_ppaddr;
+ return (PPADDR_t*)PL_ppaddr;
}
#ifndef HAS_GETENV_LEN