#endif
}
if (saveifp) { /* must use old fp? */
+ /* If fd is less that PL_maxsysfd i.e. STDIN..STDERR
- then dup the new fileno down
++ then dup the new fileno down
+ */
fd = PerlIO_fileno(saveifp);
if (saveofp) {
- PerlIO_flush(saveofp); /* emulate PerlIO_close() */
+ PerlIO_flush(saveofp); /* emulate PerlIO_close() */
if (saveofp != saveifp) { /* was a socket? */
PerlIO_close(saveofp);
- /* This looks very suspect - NI-S 24 Nov 2000 */
++ /* This looks very suspect - NI-S 24 Nov 2000 */
if (fd > 2)
- Safefree(saveofp);
+ Safefree(saveofp); /* ??? */
}
}
if (fd != PerlIO_fileno(fp)) {
#endif /* SYSV IPC */
- #ifdef SOCKS_64BIT_BUG
-
- /**
- ** getc and ungetc wrappers for the 64 bit problems with SOCKS 5 support
- ** Workaround to the problem, that SOCKS maps a socket 'getc' to revc
- ** without checking the ungetc buffer.
- **/
-
- static S64_IOB *s64_buffer = (S64_IOB *) NULL;
-
- /* initialize the buffer area */
- /* required after a fork(2) call in order to remove side effects */
- void Perl_do_s64_init_buffer() {
- s64_buffer = (S64_IOB *) NULL;
- }
-
- /* get a buffered stream pointer */
- static S64_IOB *S_s64_get_buffer( PerlIO *fp) {
- S64_IOB *ptr = s64_buffer;
- while( ptr && ptr->fp != fp)
- ptr = ptr->next;
- return( ptr);
- }
-
- /* create a buffered stream pointer */
- static S64_IOB *S_s64_create_buffer( PerlIO *f) {
- S64_IOB *ptr = malloc( sizeof( S64_IOB));
- if( ptr) {
- ptr->fp = f;
- ptr->cnt = ptr->size = 0;
- ptr->buffer = (int *) NULL;
- ptr->next = s64_buffer;
- ptr->last = (S64_IOB *) NULL;
- if( s64_buffer) s64_buffer->last = ptr;
- s64_buffer = ptr;
- }
- return( ptr);
- }
-
- /* delete a buffered stream pointer */
- void Perl_do_s64_delete_buffer( PerlIO *f) {
- S64_IOB *ptr = _s64_get_buffer(f);
- if( ptr) {
- /* fix the stream pointer according to the bytes buffered */
- /* required, if this is called in a seek-context */
- if( ptr->cnt) fseek(f,-ptr->cnt,SEEK_CUR);
- if( ptr->buffer) free( ptr->buffer);
- if( ptr->last)
- ptr->last->next = ptr->next;
- else
- s64_buffer = ptr->next;
- free( ptr);
- }
- }
+
- /* internal buffer management */
- #define _S64_BUFFER_SIZE 32
- static int S_s64_malloc( S64_IOB *ptr) {
- if( ptr) {
- if( !ptr->buffer) {
- ptr->buffer = (int *) calloc( _S64_BUFFER_SIZE, sizeof( int));
- ptr->size = ptr->cnt = 0;
- } else {
- ptr->buffer = (int *) realloc( ptr->buffer, ptr->size + _S64_BUFFER_SIZE);
- }
-
- if( !ptr->buffer)
- return( 0);
-
- ptr->size += _S64_BUFFER_SIZE;
-
- return( 1);
- }
-
- return( 0);
- }
-
- /* SOCKS 64 bit getc replacement */
- int Perl_do_s64_getc( PerlIO *f) {
- S64_IOB *ptr = _s64_get_buffer(f);
- if( ptr) {
- if( ptr->cnt)
- return( ptr->buffer[--ptr->cnt]);
- }
- return( getc(f));
- }
-
- /* SOCKS 64 bit ungetc replacement */
- int Perl_do_s64_ungetc( int ch, PerlIO *f) {
- S64_IOB *ptr = _s64_get_buffer(f);
-
- if( !ptr) ptr=_s64_create_buffer(f);
- if( !ptr) return( EOF);
- if( !ptr->buffer || (ptr->buffer && ptr->cnt >= ptr->size))
- if( !_s64_malloc( ptr)) return( EOF);
- ptr->buffer[ptr->cnt++] = ch;
-
- return( ch);
- }
-
- /* SOCKS 64 bit fread replacement */
- SSize_t Perl_do_s64_fread(void *buf, SSize_t count, PerlIO* f) {
- SSize_t len = 0;
- char *bufptr = (char *) buf;
- S64_IOB *ptr = _s64_get_buffer(f);
- if( ptr) {
- while( ptr->cnt && count) {
- *bufptr++ = ptr->buffer[--ptr->cnt];
- count--, len++;
- }
- }
- if( count)
- len += (SSize_t)fread(bufptr,1,count,f);
-
- return( len);
- }
-
- /* SOCKS 64 bit fseek replacement */
- int Perl_do_s64_seek(PerlIO* f, Off_t offset, int whence) {
- S64_IOB *ptr = _s64_get_buffer(f);
-
- /* Simply clear the buffer and seek if the position is absolute */
- if( SEEK_SET == whence || SEEK_END == whence) {
- if( ptr) ptr->cnt = 0;
-
- /* In case of relative positioning clear the buffer and calculate */
- /* a fixed offset */
- } else if( SEEK_CUR == whence) {
- if( ptr) {
- offset -= (Off_t)ptr->cnt;
- ptr->cnt = 0;
- }
- }
-
- /* leave out buffer untouched otherwise, because fseek will fail */
- /* seek now */
- return( fseeko( f, offset, whence));
- }
-
- /* SOCKS 64 bit ftell replacement */
- Off_t Perl_do_s64_tell(PerlIO* f) {
- Off_t offset = 0;
- S64_IOB *ptr = _s64_get_buffer(f);
- if( ptr)
- offset = ptr->cnt;
- return( ftello(f) - offset);
- }
-
- #endif
#
# uncomment exactly one of the following
--#
++#
# Visual C++ 2.x
#CCTYPE *= MSVC20
# Visual C++ > 2.x and < 6.x
# VC 6.0 can load the socket dll on demand. Makes the test suite
# run in about 10% less time.
--DELAYLOAD *= -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
++DELAYLOAD *= -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
# VC 6.0 seems capable of compiling perl correctly with optimizations
# enabled. Anything earlier fails tests.
# Options
#
INCLUDES = -I$(COREDIR) -I.\include -I. -I.. -I"$(CCINCDIR)"
--#PCHFLAGS = -H -Hc -H=c:\temp\bcmoduls.pch
++#PCHFLAGS = -H -Hc -H=c:\temp\bcmoduls.pch
DEFINES = -DWIN32 $(CRYPT_FLAG)
LOCDEFS = -DPERLDLL -DPERL_CORE
SUBSYS = console
LINK_DBG = -v
.ELSE
OPTIMIZE = -O2 -D_RTLDLL
--LINK_DBG =
++LINK_DBG =
.ENDIF
CFLAGS = -w -g0 -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) \
LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
OBJOUT_FLAG = -o
EXEOUT_FLAG = -e
--LIBOUT_FLAG =
++LIBOUT_FLAG =
.ELIF "$(CCTYPE)" == "GCC"
# Options
#
--INCLUDES = -I.\include -I. -I.. -I$(COREDIR)
++INCLUDES = -I.\include -I. -I.. -I$(COREDIR)
DEFINES = -DWIN32 $(CRYPT_FLAG)
LOCDEFS = -DPERLDLL -DPERL_CORE
SUBSYS = console
LINK_DBG = -g
.ELSE
OPTIMIZE = -g -O2
--LINK_DBG = -g
++LINK_DBG = -g
.ENDIF
CFLAGS = $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
OBJOUT_FLAG = -o
EXEOUT_FLAG = -o
--LIBOUT_FLAG =
++LIBOUT_FLAG =
# NOTE: we assume that GCC uses MSVCRT.DLL
BUILDOPT += -fno-strict-aliasing -DPERL_MSVCRT_READFIX
#
INCLUDES = -I$(COREDIR) -I.\include -I. -I..
--#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
++#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG)
LOCDEFS = -DPERLDLL -DPERL_CORE
SUBSYS = console
#
# Rules
--#
++#
.SUFFIXES : .c $(o) .dll $(a) .exe .rc .res
$(IMPLIB) --input-def $(*B).def --output-lib $(*B).a $@
.ELSE
$(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
-- -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
++ -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
.ENDIF
.rc.res:
MINIMOD = ..\lib\ExtUtils\Miniperl.pm
X2P = ..\x2p\a2p.exe
- # Nominate a target which causes extensions to be re-built
++# Nominate a target which causes extensions to be re-built
+# This used to be $(PERLEXE), but at worst it is the .dll that they depend
+# on and really only the interface - i.e. the .def file used to export symbols
+# from the .dll
+PERLDEP = perldll.def
+
+
PL2BAT = bin\pl2bat.pl
GLOBBAT = bin\perlglob.bat
WIN32_SRC = \
.\win32.c \
.\win32sck.c \
-- .\win32thread.c
++ .\win32thread.c
.IF "$(CRYPT_SRC)" != ""
WIN32_SRC += .\$(CRYPT_SRC)
GLOB = $(EXTDIR)\File\Glob\Glob
HOSTNAME = $(EXTDIR)\Sys\Hostname\Hostname
STORABLE = $(EXTDIR)\Storable\Storable
- FILTER = $(EXTDIR)\Filter\Util\Call
- ENCODE = $(EXTDIR)\Encode\Encode
+ FILTER = $(EXTDIR)\Filter\Util\Call\Call
-ENCODE = $(EXTDIR)\Encode\Encode
++ENCODE = $(EXTDIR)\Encode\Encode
SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
NOOP = @rem
.ELSE
MK2 = __not_needed
--RIGHTMAKE =
++RIGHTMAKE =
.ENDIF
#
#--------------------- END Win95 SPECIFIC ---------------------
# a blank target for when builds don't need to do certain things
--# this target added for Win95 port but used to keep the WinNT port able to
++# this target added for Win95 port but used to keep the WinNT port able to
# use this file
__not_needed:
$(NOOP)
$(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES)
.ELSE
$(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
-- perlglob$(o) setargv$(o)
++ perlglob$(o) setargv$(o)
.ENDIF
perlglob$(o) : perlglob.c
@$(mktmp c0x32$(o) $(MINI_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
.ELIF "$(CCTYPE)" == "GCC"
$(LINK32) -v -mconsole -o $@ $(BLINK_FLAGS) \
-- $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
++ $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
.ELSE
$(LINK32) -subsystem:console -out:$@ \
@$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
@$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
.ENDIF
--perlmain.c : runperl.c
++perlmain.c : runperl.c
copy runperl.c perlmain.c
perlmain$(o) : perlmain.c
.ENDIF
copy $(PERLEXE) $(WPERLEXE)
$(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
-- copy splittree.pl ..
++ copy splittree.pl ..
$(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
cd $(EXTDIR)\$(*B) && $(MAKE)
-$(FILTER_DLL): $(PERLEXE) $(FILTER).xs
+$(FILTER_DLL): $(PERLDEP) $(FILTER).xs
- cd $(EXTDIR)\Filter\Util && \
+ cd $(EXTDIR)\Filter\Util\Call && \
..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
- cd $(EXTDIR)\Filter\Util && $(MAKE)
+ cd $(EXTDIR)\Filter\Util\Call && $(MAKE)
-$(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL
+$(ERRNO_PM): $(PERLDEP) $(ERRNO)_pm.PL
cd $(EXTDIR)\$(*B) && \
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
cd $(EXTDIR)\$(*B) && $(MAKE)
$(RCOPY) html\*.* $(INST_HTML)\*.*
inst_lib : $(CONFIGPM)
-- copy splittree.pl ..
++ copy splittree.pl ..
$(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
$(RCOPY) ..\lib $(INST_LIB)\*.*
set HARNESS_PERL_SWITCHES=-C && \
cd ..\t && $(PERLEXE) -I..\lib harness
--clean :
++clean :
-@erase miniperlmain$(o)
-@erase $(MINIPERL)
-@erase perlglob$(o)
okfile: utils
$(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
--
++
nok: utils
$(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)"
--
++
nokfile: utils
$(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok