From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Fri, 2 Nov 2001 23:56:00 +0000 (+0000)
Subject: microperl sync.
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7114a2d26db82c459c722352adf0625e3ae9f42d;p=p5sagit%2Fp5-mst-13.2.git

microperl sync.

p4raw-id: //depot/perl@12826
---

diff --git a/doio.c b/doio.c
index 462c884..47a5af6 100644
--- a/doio.c
+++ b/doio.c
@@ -495,6 +495,7 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
 	    (void)PerlIO_close(fp);
 	    goto say_false;
 	}
+#ifndef PERL_MICRO
 	if (S_ISSOCK(PL_statbuf.st_mode))
 	    IoTYPE(io) = IoTYPE_SOCKET;	/* in case a socket was passed in to us */
 #ifdef HAS_SOCKET
@@ -515,6 +516,7 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
 		IoTYPE(io) = IoTYPE_SOCKET; /* some OS's return 0 on fstat()ed socket */
 				/* but some return 0 for streams too, sigh */
 	}
+#endif /* !PERL_MICRO */
 #endif
     }
     if (saveifp) {		/* must use old fp? */
diff --git a/perl.c b/perl.c
index 73212c0..ee55c91 100644
--- a/perl.c
+++ b/perl.c
@@ -21,7 +21,7 @@
 #include <unistd.h>
 #endif
 
-#if !defined(STANDARD_C) && !defined(HAS_GETENV_PROTOTYPE)
+#if !defined(STANDARD_C) && !defined(HAS_GETENV_PROTOTYPE) && !defined(PERL_MICRO)
 char *getenv (char *); /* Usually in <stdlib.h> */
 #endif
 
diff --git a/perl.h b/perl.h
index 2c1302d..9b6c562 100644
--- a/perl.h
+++ b/perl.h
@@ -413,11 +413,11 @@ register struct op *Perl_op asm(stringify(OP_IN_REGISTER));
 #   include <unistd.h>
 #endif
 
-#if defined(HAS_SYSCALL) && !defined(HAS_SYSCALL_PROTO)
+#if defined(HAS_SYSCALL) && !defined(HAS_SYSCALL_PROTO) && !defined(PERL_MICRO)
 int syscall(int, ...);
 #endif
 
-#if defined(HAS_USLEEP) && !defined(HAS_USLEEP_PROTO)
+#if defined(HAS_USLEEP) && !defined(HAS_USLEEP_PROTO) && !defined(PERL_MICRO)
 int usleep(unsigned int);
 #endif
 
@@ -803,7 +803,7 @@ int sockatmark(int);
  * in the face of half-implementations.)
  */
 
-#ifdef I_SYSMODE
+#if defined(I_SYSMODE) && !defined(PERL_MICRO)
 #include <sys/mode.h>
 #endif
 
@@ -1285,7 +1285,7 @@ typedef NVTYPE NV;
 #    define Perl_fp_class_zero(x)	(Perl_fp_class(x)==FP_CLASS_NZERO||Perl_fp_class(x)==FP_CLASS_PZERO)
 #endif
 
-#if !defined(Perl_fp_class) && defined(HAS_FP_CLASS)
+#if !defined(Perl_fp_class) && defined(HAS_FP_CLASS) && !defined(PERL_MICRO)
 #    include <math.h>
 #    if !defined(FP_SNAN) && defined(I_FP_CLASS)
 #        include <fp_class.h>
diff --git a/perlio.c b/perlio.c
index 62f0d37..51962db 100644
--- a/perlio.c
+++ b/perlio.c
@@ -175,6 +175,7 @@ PerlIO_binmode(pTHX_ PerlIO *fp, int iotype, int mode, const char *names)
 PerlIO *
 PerlIO_fdupopen(pTHX_ PerlIO *f, CLONE_PARAMS *param)
 {
+#ifndef PERL_MICRO
     if (f) {
 	int fd = PerlLIO_dup(PerlIO_fileno(f));
 	if (fd >= 0) {
@@ -189,6 +190,7 @@ PerlIO_fdupopen(pTHX_ PerlIO *f, CLONE_PARAMS *param)
     else {
 	SETERRNO(EBADF, SS$_IVCHAN);
     }
+#endif
     return NULL;
 }
 
diff --git a/regexec.c b/regexec.c
index a7a9a67..67e9015 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2254,7 +2254,7 @@ S_regmatch(pTHX_ regnode *prog)
 		    if (l >= PL_regeol)
 			sayNO;
 		    toLOWER_utf8((U8*)l, tmpbuf, &ulen);
-		    if (memNE(s, tmpbuf, ulen))
+		    if (memNE(s, (char*)tmpbuf, ulen))
 		        sayNO;
 		    s += UTF8SKIP(s);
 		    l += ulen;
@@ -2528,7 +2528,7 @@ S_regmatch(pTHX_ regnode *prog)
 			    sayNO;
 			toLOWER_utf8((U8*)s, tmpbuf1, &ulen1);
 			toLOWER_utf8((U8*)l, tmpbuf2, &ulen2);
-			if (ulen1 != ulen2 || memNE(tmpbuf1, tmpbuf2, ulen1))
+			if (ulen1 != ulen2 || memNE((char *)tmpbuf1, (char *)tmpbuf2, ulen1))
 			    sayNO;
 			s += ulen1;
 			l += ulen2;