more exported symbols needed for build on windows
[p5sagit/p5-mst-13.2.git] / win32 / win32.c
index c762115..a50e8db 100644 (file)
@@ -1690,6 +1690,8 @@ FAILED:
     return -1;
 }
 
+#ifndef PERL_OBJECT
+
 static UINT timerid = 0;
 
 static VOID CALLBACK TimerProc(HWND win, UINT msg, UINT id, DWORD time)
@@ -1699,10 +1701,12 @@ static VOID CALLBACK TimerProc(HWND win, UINT msg, UINT id, DWORD time)
     timerid=0;  
     sighandler(14);
 }
+#endif /* !PERL_OBJECT */
 
 DllExport unsigned int
 win32_alarm(unsigned int sec)
 {
+#ifndef PERL_OBJECT
     /* 
      * the 'obvious' implentation is SetTimer() with a callback
      * which does whatever receiving SIGALRM would do 
@@ -1727,6 +1731,7 @@ win32_alarm(unsigned int sec)
         timerid=0;  
        }
      }
+#endif /* !PERL_OBJECT */
     return 0;
 }
 
@@ -1797,6 +1802,7 @@ EXTERN_C _CRTIMP ioinfo* __pioinfo[];
 #ifdef USE_FIXED_OSFHANDLE
 
 #define FOPEN                  0x01    /* file handle open */
+#define FNOINHERIT             0x10    /* file handle opened O_NOINHERIT */
 #define FAPPEND                        0x20    /* file handle opened O_APPEND */
 #define FDEV                   0x40    /* file handle refers to device */
 #define FTEXT                  0x80    /* file handle is in text mode */
@@ -1837,7 +1843,8 @@ EXTERN_C _CRTIMP ioinfo* __pioinfo[];
 
 /* create an ioinfo entry, kill its handle, and steal the entry */
 
-static int _alloc_osfhnd()
+static int
+_alloc_osfhnd(void)
 {
     HANDLE hF = CreateFile("NUL", 0, 0, NULL, OPEN_ALWAYS, 0, NULL);
     int fh = _open_osfhandle((long)hF, 0);
@@ -1863,6 +1870,9 @@ my_open_osfhandle(long osfhandle, int flags)
     if (flags & O_TEXT)
        fileflags |= FTEXT;
 
+    if (flags & O_NOINHERIT)
+       fileflags |= FNOINHERIT;
+
     /* attempt to allocate a C Runtime file handle */
     if ((fh = _alloc_osfhnd()) == -1) {
        errno = EMFILE;         /* too many open files */
@@ -2449,7 +2459,7 @@ win32_link(const char *oldname, const char *newname)
     WCHAR wNewName[MAX_PATH+1];
 
     if (IsWin95())
-       Perl_die(aTHX_ PL_no_func, "link");
+       Perl_croak(aTHX_ PL_no_func, "link");
 
     pfnCreateHardLinkW =
        (BOOL (__stdcall *)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES))
@@ -2671,7 +2681,8 @@ win32_dup2(int fd1,int fd2)
 #define FTEXT          0x80    /* file handle is in text mode */
 #define MAX_DESCRIPTOR_COUNT   (64*32) /* this is the maximun that MSVCRT can handle */
 
-int __cdecl _fixed_read(int fh, void *buf, unsigned cnt)
+int __cdecl
+_fixed_read(int fh, void *buf, unsigned cnt)
 {
     int bytes_read;                 /* number of bytes read */
     char *buffer;                   /* buffer to read to */