DBL_EPSILON DBL_MIN FLT_EPSILON FLT_MIN are not C constant expressions
[p5sagit/p5-mst-13.2.git] / cygwin / cygwin.c
index 21f3b34..b774394 100644 (file)
@@ -10,6 +10,7 @@
 #include <unistd.h>
 #include <process.h>
 #include <sys/cygwin.h>
+#include <alloca.h>
 
 /*
  * pp_system() implemented via spawn()
@@ -23,8 +24,8 @@ do_spawnvp (const char *path, const char * const *argv)
     Sigsave_t ihand,qhand;
     int childpid, result, status;
 
-    rsignal_save(SIGINT, SIG_IGN, &ihand);
-    rsignal_save(SIGQUIT, SIG_IGN, &qhand);
+    rsignal_save(SIGINT, (Sighandler_t) SIG_IGN, &ihand);
+    rsignal_save(SIGQUIT, (Sighandler_t) SIG_IGN, &qhand);
     childpid = spawnvp(_P_NOWAIT,path,argv);
     if (childpid < 0) {
        status = -1;
@@ -57,7 +58,7 @@ do_aspawn (SV *really, void **mark, void **sp)
 
     while (++mark <= sp)
         if (*mark)
-            *a++ = SvPVx(*mark, n_a);
+            *a++ = SvPVx((SV *)*mark, n_a);
         else
             *a++ = "";
     *a = Nullch;
@@ -137,7 +138,6 @@ do_spawn (char *cmd)
 }
 
 /* see also Cwd.pm */
-static
 XS(Cygwin_cwd)
 {
     dXSARGS;
@@ -147,7 +147,7 @@ XS(Cygwin_cwd)
        Perl_croak(aTHX_ "Usage: Cwd::cwd()");
     if((cwd = getcwd(NULL, -1))) {
        ST(0) = sv_2mortal(newSVpv(cwd, 0));
-       safesysfree(cwd);
+       free(cwd);
 #ifndef INCOMPLETE_TAINTS
        SvTAINTED_on(ST(0));
 #endif
@@ -156,7 +156,6 @@ XS(Cygwin_cwd)
     XSRETURN_UNDEF;
 }
 
-static
 XS(XS_Cygwin_pid_to_winpid)
 {
     dXSARGS;
@@ -175,7 +174,6 @@ XS(XS_Cygwin_pid_to_winpid)
     XSRETURN_UNDEF;
 }
 
-static
 XS(XS_Cygwin_winpid_to_pid)
 {
     dXSARGS;
@@ -199,9 +197,16 @@ void
 init_os_extras(void)
 {
     char *file = __FILE__;
+    CV *cv;
     dTHX;
 
     newXS("Cwd::cwd", Cygwin_cwd, file);
     newXS("Cygwin::winpid_to_pid", XS_Cygwin_winpid_to_pid, file);
     newXS("Cygwin::pid_to_winpid", XS_Cygwin_pid_to_winpid, file);
+
+    if ((cv = get_cv("Win32CORE::bootstrap", 0))) {
+       dSP;
+       PUSHMARK(SP);
+       (void)call_sv((SV *)cv, G_EVAL|G_DISCARD|G_VOID);
+    }
 }