From: Gurusamy Sarathy Date: Sun, 5 Dec 1999 11:41:04 +0000 (+0000) Subject: windows build tweaks for Borland compiler X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ce4f76ea90ddd8879f53d5ef4d9ff6bb82eb5f0;p=p5sagit%2Fp5-mst-13.2.git windows build tweaks for Borland compiler p4raw-id: //depot/perl@4654 --- diff --git a/win32/makefile.mk b/win32/makefile.mk index 5b518c2..a8c5d78 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -76,13 +76,13 @@ INST_ARCH *= \$(ARCHNAME) # tests. This should be enabled to get the fork() emulation. Do not # enable unless you know what you're doing! # -USE_ITHREADS *= define +#USE_ITHREADS *= define # # uncomment to enable the implicit "host" layer for all system calls # made by perl. This is needed and auto-enabled by USE_OBJECT above. # -USE_IMP_SYS *= define +#USE_IMP_SYS *= define # # uncomment exactly one of the following @@ -950,6 +950,7 @@ $(MINIDIR)\gcrt0$(o): .\gstartup.c # this target added for Win95 port but used to keep the WinNT port able to # use this file __not_needed: + $(NOOP) $(GLOBEXE) : perlglob$(o) .IF "$(CCTYPE)" == "BORLAND" diff --git a/win32/perlhost.h b/win32/perlhost.h index dcc8adb..01ff73d 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -782,6 +782,21 @@ PerlStdIOFdupopen(struct IPerlStdIO* piPerl, PerlIO* pf) int fileno = win32_dup(win32_fileno((FILE*)pf)); /* open the file in the same mode */ +#ifdef __BORLANDC__ + if(((FILE*)pf)->flags & _F_READ) { + mode[0] = 'r'; + mode[1] = 0; + } + else if(((FILE*)pf)->flags & _F_WRIT) { + mode[0] = 'a'; + mode[1] = 0; + } + else if(((FILE*)pf)->flags & _F_RDWR) { + mode[0] = 'r'; + mode[1] = '+'; + mode[2] = 0; + } +#else if(((FILE*)pf)->_flag & _IOREAD) { mode[0] = 'r'; mode[1] = 0; @@ -795,6 +810,7 @@ PerlStdIOFdupopen(struct IPerlStdIO* piPerl, PerlIO* pf) mode[1] = '+'; mode[2] = 0; } +#endif /* it appears that the binmode is attached to the * file descriptor so binmode files will be handled diff --git a/win32/win32.c b/win32/win32.c index 4c13d4a..4e67352 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2369,8 +2369,13 @@ Nt4CreateHardLinkW( StreamId.dwStreamId = BACKUP_LINK; StreamId.dwStreamAttributes = 0; StreamId.dwStreamNameSize = 0; +#ifdef __BORLANDC__ + StreamId.Size.u.HighPart = 0; + StreamId.Size.u.LowPart = dwLen; +#else StreamId.Size.HighPart = 0; StreamId.Size.LowPart = dwLen; +#endif bSuccess = pfnBackupWrite(handle, (LPBYTE)&StreamId, dwSize, &dwWritten, FALSE, FALSE, &lpContext); diff --git a/win32/win32.h b/win32/win32.h index d3224f1..50b4f19 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -167,6 +167,7 @@ struct utsname { #define _access access #define _chdir chdir +#define _getpid getpid #include #ifndef DllMain