From: Nicholas Clark Date: Mon, 23 Oct 2000 15:39:32 +0000 (+0100) Subject: Check if stdio supports tweaking lval and cnt simultaneously. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a7ffa9b9a1a8caeff31a83d25b70b5aca6ba0d12;p=p5sagit%2Fp5-mst-13.2.git Check if stdio supports tweaking lval and cnt simultaneously. Subject: PATCH (Re: PerlIO - Configure tweak for Linux/glibc?) Message-ID: <20001023153932.A10786@plum.flirble.org> p4raw-id: //depot/perl@7427 --- diff --git a/Configure b/Configure index 03004be..1425389 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Thu Oct 19 22:28:50 EET DST 2000 [metaconfig 3.0 PL70] +# Generated on Tue Oct 24 21:00:34 EET DST 2000 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >/tmp/c1$$ <&4 +$cat >try.c < +/* Can we scream? */ +/* Eat dust sed :-) */ +#define FILE_ptr(fp) $stdio_ptr +#define FILE_cnt(fp) $stdio_cnt +int main() { + FILE *fp = fopen("try.c", "r"); + char c = getc(fp); + char *ptr; + size_t cnt; + if (!( + 18 <= FILE_cnt(fp) && + strncmp(FILE_ptr(fp), "include \n", 18) == 0 + )) { + puts("Fail even to read"); + exit (1); + } + ptr = FILE_ptr(fp); + cnt = FILE_cnt(fp); + + FILE_ptr(fp)+= 42; + + if (FILE_ptr(fp) != (ptr + 42)) { + printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42)); + exit (1); + } + if (FILE_cnt(fp) <= 20) { + printf ("Fail (<20 chars to test)"); + exit (1); + } + if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) { + puts("Fail compare"); + exit (1); + } + if (cnt == FILE_cnt(fp)) { + puts("Pass_unchanged"); + exit (0); + } + if (FILE_cnt(fp) == (cnt - 42)) { + puts("Pass_changed"); + exit (0); + } + printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp)); + return 1; + +} +EOP + set try + if eval $compile; then + case `./try$exe_ext` in + Pass_changed) + echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4 + d_stdio_ptr_lval_sets_cnt="$define" ;; + Pass_unchanged) + echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4 + d_stdio_ptr_lval_nochange_cnt="$define" ;; + Fail*) + echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;; + *) + echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;; + esac + else + echo "It seems we can't set ptr in your stdio. Nevermind." >&4 + fi + $rm -f try.c try + ;; +esac + : see if _base is also standard val="$undef" case "$d_stdstdio" in @@ -15580,6 +15658,8 @@ d_statfs_s='$d_statfs_s' d_statvfs='$d_statvfs' d_stdio_cnt_lval='$d_stdio_cnt_lval' d_stdio_ptr_lval='$d_stdio_ptr_lval' +d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt' +d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt' d_stdio_stream_array='$d_stdio_stream_array' d_stdiobase='$d_stdiobase' d_stdstdio='$d_stdstdio' diff --git a/Porting/Glossary b/Porting/Glossary index 1b93821..40e468d 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -1478,6 +1478,15 @@ d_stdio_ptr_lval (d_stdstdio.U): This variable conditionally defines STDIO_PTR_LVALUE if the FILE_ptr macro can be used as an lvalue. +d_stdio_ptr_lval_nochange_cnt (d_stdstdio.U): + This symbol is defined if using the FILE_ptr macro as an lvalue + to increase the pointer by n leaves File_cnt(fp) unchanged. + +d_stdio_ptr_lval_sets_cnt (d_stdstdio.U): + This symbol is defined if using the FILE_ptr macro as an lvalue + to increase the pointer by n has the side effect of decreasing the + value of File_cnt(fp) by n. + d_stdio_stream_array (stdio_streams.U): This variable tells whether there is an array holding the stdio streams. diff --git a/Porting/config.sh b/Porting/config.sh index 632c469..2c9a49e 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -8,7 +8,7 @@ # Package name : perl5 # Source directory : /m/fs/work/work/permanent/perl/pp4/perl -# Configuration time: Fri Oct 13 02:12:22 EET DST 2000 +# Configuration time: Tue Oct 24 21:07:39 EET DST 2000 # Configured by : jhi # Target system : osf1 alpha.hut.fi v4.0 878 alpha @@ -62,7 +62,7 @@ ccsymbols='__alpha=1 __LANGUAGE_C__=1 __osf__=1 __unix__=1 _LONGLONG=1 _SYSTYPE_ ccversion='V5.6-082' cf_by='jhi' cf_email='yourname@yourhost.yourplace.com' -cf_time='Fri Oct 13 02:12:22 EET DST 2000' +cf_time='Tue Oct 24 21:07:39 EET DST 2000' charsize='1' chgrp='' chmod='' @@ -336,6 +336,8 @@ d_statfs_s='define' d_statvfs='define' d_stdio_cnt_lval='define' d_stdio_ptr_lval='define' +d_stdio_ptr_lval_nochange_cnt='undef' +d_stdio_ptr_lval_sets_cnt='undef' d_stdio_stream_array='define' d_stdiobase='define' d_stdstdio='define' diff --git a/Porting/config_H b/Porting/config_H index 149760c..3cbfeae 100644 --- a/Porting/config_H +++ b/Porting/config_H @@ -17,7 +17,7 @@ /* * Package name : perl5 * Source directory : /m/fs/work/work/permanent/perl/pp4/perl - * Configuration time: Fri Oct 13 02:12:22 EET DST 2000 + * Configuration time: Tue Oct 24 21:07:39 EET DST 2000 * Configured by : jhi * Target system : osf1 alpha.hut.fi v4.0 878 alpha */ @@ -2028,12 +2028,23 @@ * This symbol is defined if the FILE_cnt macro can be used as an * lvalue. */ +/* STDIO_PTR_LVAL_SETS_CNT: + * This symbol is defined if using the FILE_ptr macro as an lvalue + * to increase the pointer by n has the side effect of decreasing the + * value of File_cnt(fp) by n. + */ +/* STDIO_PTR_LVAL_NOCHANGE_CNT: + * This symbol is defined if using the FILE_ptr macro as an lvalue + * to increase the pointer by n leaves File_cnt(fp) unchanged. + */ #define USE_STDIO_PTR /**/ #ifdef USE_STDIO_PTR #define FILE_ptr(fp) ((fp)->_ptr) #define STDIO_PTR_LVALUE /**/ #define FILE_cnt(fp) ((fp)->_cnt) #define STDIO_CNT_LVALUE /**/ +/*#define STDIO_PTR_LVAL_SETS_CNT / **/ +/*#define STDIO_PTR_LVAL_NOCHANGE_CNT / **/ #endif /* USE_STDIO_BASE: diff --git a/config_h.SH b/config_h.SH index a209e6d..e34d920 100644 --- a/config_h.SH +++ b/config_h.SH @@ -2048,12 +2048,23 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un * This symbol is defined if the FILE_cnt macro can be used as an * lvalue. */ +/* STDIO_PTR_LVAL_SETS_CNT: + * This symbol is defined if using the FILE_ptr macro as an lvalue + * to increase the pointer by n has the side effect of decreasing the + * value of File_cnt(fp) by n. + */ +/* STDIO_PTR_LVAL_NOCHANGE_CNT: + * This symbol is defined if using the FILE_ptr macro as an lvalue + * to increase the pointer by n leaves File_cnt(fp) unchanged. + */ #$d_stdstdio USE_STDIO_PTR /**/ #ifdef USE_STDIO_PTR #define FILE_ptr(fp) $stdio_ptr #$d_stdio_ptr_lval STDIO_PTR_LVALUE /**/ #define FILE_cnt(fp) $stdio_cnt #$d_stdio_cnt_lval STDIO_CNT_LVALUE /**/ +#$d_stdio_ptr_lval_sets_cnt STDIO_PTR_LVAL_SETS_CNT /**/ +#$d_stdio_ptr_lval_nochange_cnt STDIO_PTR_LVAL_NOCHANGE_CNT /**/ #endif /* USE_STDIO_BASE: diff --git a/configure.com b/configure.com index f4b607a..84f07de 100644 --- a/configure.com +++ b/configure.com @@ -4373,7 +4373,6 @@ $ d_mbstowcs="define" $ d_mbtowc="define" $ d_stdiobase="define" $ d_stdio_cnt_lval="define" -$ d_stdio_ptr_lval="define" $ d_stdstdio="define" $ d_wcstombs="define" $ d_mblen="define" @@ -4402,6 +4401,8 @@ $ i_locale="undef" $ d_locconv="undef" $ d_setlocale="undef" $ ENDIF +$ d_stdio_ptr_lval_sets_cnt="undef" +$ d_stdio_ptr_lval_nochange_cnt="undef" $! $! Sockets? $ if Has_Socketshr .OR. Has_Dec_C_Sockets @@ -4935,6 +4936,8 @@ $ WC "d_statfs_s='undef'" $ WC "d_statfsflags='undef'" $ WC "d_stdio_cnt_lval='" + d_stdio_cnt_lval + "'" $ WC "d_stdio_ptr_lval='" + d_stdio_ptr_lval + "'" +$ WC "d_stdio_ptr_lval_sets_cnt='" + d_stdio_ptr_lval_sets_cnt + "'" +$ WC "d_stdio_ptr_lval_nochange_cnt='" + d_stdio_ptr_lval_nochange_cnt + "'" $ WC "d_stdio_stream_array='undef'" $ WC "d_stdiobase='" + d_stdiobase + "'" $ WC "d_stdstdio='" + d_stdstdio + "'" diff --git a/epoc/config.sh b/epoc/config.sh index ee65ee3..e760d67 100644 --- a/epoc/config.sh +++ b/epoc/config.sh @@ -324,6 +324,8 @@ d_statfsflags='define' d_statvfs='undef' d_stdio_cnt_lval='define' d_stdio_ptr_lval='define' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_ptr_lval_nochange_cnt='undef' d_stdio_stream_array='undef' d_stdiobase='undef' d_stdstdio='undef' diff --git a/iperlsys.h b/iperlsys.h index 59da474..6844801 100644 --- a/iperlsys.h +++ b/iperlsys.h @@ -186,13 +186,19 @@ struct IPerlStdIOInfo #ifdef USE_STDIO_PTR # define PerlIO_has_cntptr(f) 1 -# ifdef STDIO_CNT_LVALUE -# define PerlIO_canset_cnt(f) 1 -# ifdef STDIO_PTR_LVALUE +# ifdef STDIO_PTR_LVALUE +# ifdef STDIO_CNT_LVALUE +# define PerlIO_canset_cnt(f) 1 +# ifdef STDIO_PTR_LVAL_NOCHANGE_CNT +# define PerlIO_fast_gets(f) 1 +# endif +# else /* STDIO_CNT_LVALUE */ +# define PerlIO_canset_cnt(f) 0 +# endif +# else /* STDIO_PTR_LVALUE */ +# ifdef STDIO_PTR_LVAL_SETS_CNT # define PerlIO_fast_gets(f) 1 # endif -# else -# define PerlIO_canset_cnt(f) 0 # endif #else /* USE_STDIO_PTR */ # define PerlIO_has_cntptr(f) 0 diff --git a/perlio.c b/perlio.c index a88daa5..969b8d1 100644 --- a/perlio.c +++ b/perlio.c @@ -176,10 +176,14 @@ PerlIO_set_ptrcnt(PerlIO *f, STDCHAR *ptr, int cnt) #else Perl_croak(aTHX_ "Cannot set 'ptr' of FILE * on this system"); #endif -#if defined(USE_STDIO_PTR) && defined(STDIO_CNT_LVALUE) +#if defined(USE_STDIO_PTR) && defined(STDIO_CNT_LVALUE) && defined (STDIO_PTR_LVAL_NOCHANGE_CNT) FILE_cnt(f) = cnt; #else - Perl_croak(aTHX_ "Cannot set 'cnt' of FILE * on this system"); +#if defined(STDIO_PTR_LVAL_SETS_CNT) + assert (FILE_cnt(f) == cnt); +#else + Perl_croak(aTHX_ "Cannot set 'cnt' of FILE * on this system when setting 'ptr'"); +#endif #endif } diff --git a/perlsdio.h b/perlsdio.h index c4a1179..90ca534 100644 --- a/perlsdio.h +++ b/perlsdio.h @@ -97,20 +97,30 @@ #ifdef STDIO_CNT_LVALUE #define PerlIO_canset_cnt(f) 1 +#define PerlIO_set_cnt(f,c) (FILE_cnt(f) = (c)) #ifdef STDIO_PTR_LVALUE +#ifdef STDIO_PTR_LVAL_NOCHANGE_CNT #define PerlIO_fast_gets(f) 1 #endif -#define PerlIO_set_cnt(f,c) (FILE_cnt(f) = (c)) -#else +#endif /* STDIO_PTR_LVALUE */ +#else /* STDIO_CNT_LVALUE */ #define PerlIO_canset_cnt(f) 0 #define PerlIO_set_cnt(f,c) abort() #endif #ifdef STDIO_PTR_LVALUE -#define PerlIO_set_ptrcnt(f,p,c) (FILE_ptr(f) = (p), PerlIO_set_cnt(f,c)) +#ifdef STDIO_PTR_LVAL_NOCHANGE_CNT +#define PerlIO_set_ptrcnt(f,p,c) STMT_START {FILE_ptr(f) = (p), PerlIO_set_cnt(f,c)} STMT_END +#else +#ifdef STDIO_PTR_LVAL_SETS_CNT +/* assert() may pre-process to ""; potential syntax error (FILE_ptr(), ) */ +#define PerlIO_set_ptrcnt(f,p,c) STMT_START {FILE_ptr(f) = (p); assert(FILE_cnt(f) == (c))} STMT_END +#define PerlIO_fast_gets(f) 1 #else #define PerlIO_set_ptrcnt(f,p,c) abort() #endif +#endif +#endif #else /* USE_STDIO_PTR */ diff --git a/perlsfio.h b/perlsfio.h index d0f6471..a736371 100644 --- a/perlsfio.h +++ b/perlsfio.h @@ -52,10 +52,10 @@ extern int _stdprintf _ARG_((const char*, ...)); #define PerlIO_has_cntptr(f) 1 #define PerlIO_get_ptr(f) ((f)->next) #define PerlIO_get_cnt(f) ((f)->endr - (f)->next) -#define PerlIO_canset_cnt(f) 1 -#define PerlIO_fast_gets(f) 1 -#define PerlIO_set_ptrcnt(f,p,c) ((f)->next = (unsigned char *)(p)) -#define PerlIO_set_cnt(f,c) 1 +#define PerlIO_canset_cnt(f) 0 +#define PerlIO_fast_gets(f) 1 +#define PerlIO_set_ptrcnt(f,p,c) STMT_START {(f)->next = (unsigned char *)(p); assert(FILE_cnt(f) == (c))} STMT_END +#define PerlIO_set_cnt(f,c) Perl_croak(aTHX_ "Cannot set 'cnt' of FILE * on this system"); #define PerlIO_has_base(f) 1 #define PerlIO_get_base(f) ((f)->data) diff --git a/pod/Makefile.SH b/pod/Makefile.SH index ae6262c..efc6ac2 100644 --- a/pod/Makefile.SH +++ b/pod/Makefile.SH @@ -73,7 +73,9 @@ converters: $(CONVERTERS) regen_pods: perlmodlib.pod toc buildtoc: buildtoc.PL perl.pod ../MANIFEST - $(PERL) -I ../lib buildtoc.PL + $(PERL) buildtoc.PL + +perltoc.pod: buildtoc man: pod2man $(MAN) @@ -82,7 +84,7 @@ html: pod2html $(HTML) tex: pod2latex $(TEX) toc: buildtoc - $(PERL) -I../lib buildtoc + $(PERL) buildtoc .SUFFIXES: .pm .pod diff --git a/pod/perltoc.pod b/pod/perltoc.pod index b87b3ab..4174512 100644 --- a/pod/perltoc.pod +++ b/pod/perltoc.pod @@ -4149,9 +4149,9 @@ B AvFILL, av_clear, av_delete, av_exists, av_extend, av_fetch, av_fill, av_len, av_make, av_pop, av_push, av_shift, av_store, av_undef, av_unshift, bytes_to_utf8, call_argv, call_method, call_pv, call_sv, CLASS, Copy, -croak, CvSTASH, dMARK, dORIGMARK, dSP, dXSARGS, dXSI32, ENTER, eval_pv, -eval_sv, EXTEND, fbm_compile, fbm_instr, FREETMPS, get_av, get_cv, get_hv, -get_sv, GIMME, GIMME_V, GvSV, gv_fetchmeth, gv_fetchmethod, +croak, CvSTASH, cv_const_sv, dMARK, dORIGMARK, dSP, dXSARGS, dXSI32, ENTER, +eval_pv, eval_sv, EXTEND, fbm_compile, fbm_instr, FREETMPS, get_av, get_cv, +get_hv, get_sv, GIMME, GIMME_V, GvSV, gv_fetchmeth, gv_fetchmethod, gv_fetchmethod_autoload, gv_stashpv, gv_stashsv, G_ARRAY, G_DISCARD, G_EVAL, G_NOARGS, G_SCALAR, G_VOID, HEf_SVKEY, HeHASH, HeKEY, HeKLEN, HePV, HeSVKEY, HeSVKEY_force, HeSVKEY_set, HeVAL, HvNAME, hv_clear, hv_delete, @@ -6879,7 +6879,7 @@ FILL, MAX, OFF, ARRAY, AvFLAGS =item B::CV METHODS STASH, START, ROOT, GV, FILE, DEPTH, PADLIST, OUTSIDE, XSUB, XSUBANY, -CvFLAGS +CvFLAGS, const_sv =item B::HV METHODS @@ -9217,21 +9217,21 @@ pasthru (o) =item Using Attributes and Parameters -AUTHOR, ABSTRACT, ABSTRACT_FROM, BINARY_LOCATION, C, CAPI, CCFLAGS, CONFIG, +ABSTRACT, ABSTRACT_FROM, AUTHOR, BINARY_LOCATION, C, CAPI, CCFLAGS, CONFIG, CONFIGURE, DEFINE, DIR, DISTNAME, DL_FUNCS, DL_VARS, EXCLUDE_EXT, EXE_FILES, FIRST_MAKEFILE, FULLPERL, FUNCLIST, H, HTMLLIBPODS, HTMLSCRIPTPODS, IMPORTS, INC, INCLUDE_EXT, INSTALLARCHLIB, INSTALLBIN, INSTALLDIRS, INSTALLHTMLPRIVLIBDIR, INSTALLHTMLSCRIPTDIR, INSTALLHTMLSITELIBDIR, INSTALLMAN1DIR, INSTALLMAN3DIR, INSTALLPRIVLIB, INSTALLSCRIPT, INSTALLSITEARCH, INSTALLSITELIB, INST_ARCHLIB, INST_BIN, -INST_EXE, INST_LIB, INST_HTMLLIBDIR, INST_HTMLSCRIPTDIR, INST_MAN1DIR, -INST_MAN3DIR, INST_SCRIPT, PERL_MALLOC_OK, LDFROM, LIB, LIBPERL_A, LIBS, -LINKTYPE, MAKEAPERL, MAKEFILE, MAN1PODS, MAN3PODS, MAP_TARGET, MYEXTLIB, -NAME, NEEDS_LINKING, NOECHO, NORECURS, NO_VC, OBJECT, OPTIMIZE, PERL, -PERLMAINCC, PERL_ARCHLIB, PERL_LIB, PERL_SRC, PERM_RW, PERM_RWX, PL_FILES, -PM, PMLIBDIRS, POLLUTE, PPM_INSTALL_EXEC, PPM_INSTALL_SCRIPT, PREFIX, -PREREQ_PM, SKIP, TYPEMAPS, VERSION, VERSION_FROM, XS, XSOPT, XSPROTOARG, -XS_VERSION +INST_EXE, INST_HTMLLIBDIR, INST_HTMLSCRIPTDIR, INST_LIB, INST_MAN1DIR, +INST_MAN3DIR, INST_SCRIPT, LDFROM, LIB, LIBPERL_A, LIBS, LINKTYPE, +MAKEAPERL, MAKEFILE, MAN1PODS, MAN3PODS, MAP_TARGET, MYEXTLIB, NAME, +NEEDS_LINKING, NOECHO, NORECURS, NO_VC, OBJECT, OPTIMIZE, PERL, PERLMAINCC, +PERL_ARCHLIB, PERL_LIB, PERL_MALLOC_OK, PERL_SRC, PERM_RW, PERM_RWX, +PL_FILES, PM, PMLIBDIRS, POLLUTE, PPM_INSTALL_EXEC, PPM_INSTALL_SCRIPT, +PREFIX, PREREQ_PM, SKIP, TYPEMAPS, VERSION, VERSION_FROM, XS, XSOPT, +XSPROTOARG, XS_VERSION =item Additional lowercase attributes diff --git a/uconfig.h b/uconfig.h index 96d3264..67cc252 100644 --- a/uconfig.h +++ b/uconfig.h @@ -2024,12 +2024,23 @@ * This symbol is defined if the FILE_cnt macro can be used as an * lvalue. */ +/* STDIO_PTR_LVAL_SETS_CNT: + * This symbol is defined if using the FILE_ptr macro as an lvalue + * to increase the pointer by n has the side effect of decreasing the + * value of File_cnt(fp) by n. + */ +/* STDIO_PTR_LVAL_NOCHANGE_CNT: + * This symbol is defined if using the FILE_ptr macro as an lvalue + * to increase the pointer by n leaves File_cnt(fp) unchanged. + */ /*#define USE_STDIO_PTR / **/ #ifdef USE_STDIO_PTR #define FILE_ptr(fp) ((fp)->_IO_read_ptr) -/*#define STDIO_PTR_LVALUE / **/ +# STDIO_PTR_LVALUE /**/ #define FILE_cnt(fp) ((fp)->_IO_read_end - (fp)->_IO_read_ptr) /*#define STDIO_CNT_LVALUE / **/ +/*#define STDIO_PTR_LVAL_SETS_CNT / **/ +/*#define STDIO_PTR_LVAL_NOCHANGE_CNT / **/ #endif /* USE_STDIO_BASE: diff --git a/uconfig.sh b/uconfig.sh index faf618a..eb8e052 100755 --- a/uconfig.sh +++ b/uconfig.sh @@ -254,7 +254,8 @@ d_statfs_f_flags='undef' d_statfs_s='undef' d_statvfs='undef' d_stdio_cnt_lval='undef' -d_stdio_ptr_lval='undef' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_ptr_lval_nochange_cnt='undef' d_stdio_stream_array='undef' d_stdiobase='undef' d_stdstdio='undef' diff --git a/vms/genconfig.pl b/vms/genconfig.pl index e500e76..ef1d5ad 100644 --- a/vms/genconfig.pl +++ b/vms/genconfig.pl @@ -229,6 +229,8 @@ foreach (@ARGV) { d_wcstombs d_wctomb d_mblen d_mktime d_strcoll d_strxfrm ]) { print OUT "$_='$rtlhas'\n"; } + print OUT "d_stdio_ptr_lval_sets_cnt='undef'\n"; + print OUT "d_stdio_ptr_lval_nochange_cnt='undef'\n"; foreach (qw[ d_gettimeod d_uname d_truncate d_wait4 d_index d_pathconf d_fpathconf d_sysconf d_sigsetjmp ]) { print OUT "$_='$rtlnew'\n"; diff --git a/vos/config.def b/vos/config.def index 4edc806..0f67dee 100644 --- a/vos/config.def +++ b/vos/config.def @@ -238,6 +238,8 @@ $d_statfs_f_flags='undef' $d_statfs_s='undef' $d_stdio_cnt_lval='define' $d_stdio_ptr_lval='define' +$d_stdio_ptr_lval_sets_cnt='undef' +$d_stdio_ptr_lval_nochange_cnt='undef' $d_stdio_stream_array='define' $d_stdiobase='define' $d_stdstdio='define' diff --git a/vos/config.h b/vos/config.h index 985e6ea..5c1e020 100644 --- a/vos/config.h +++ b/vos/config.h @@ -2024,12 +2024,23 @@ * This symbol is defined if the FILE_cnt macro can be used as an * lvalue. */ +/* STDIO_PTR_LVAL_SETS_CNT: + * This symbol is defined if using the FILE_ptr macro as an lvalue + * to increase the pointer by n has the side effect of decreasing the + * value of File_cnt(fp) by n. + */ +/* STDIO_PTR_LVAL_NOCHANGE_CNT: + * This symbol is defined if using the FILE_ptr macro as an lvalue + * to increase the pointer by n leaves File_cnt(fp) unchanged. + */ #define USE_STDIO_PTR /**/ #ifdef USE_STDIO_PTR #define FILE_ptr(fp) ((fp)->_ptr) #define STDIO_PTR_LVALUE /**/ #define FILE_cnt(fp) ((fp)->_cnt) #define STDIO_CNT_LVALUE /**/ +/*#define STDIO_PTR_LVAL_SETS_CNT /**/ +/*#define STDIO_PTR_LVAL_NOCHANGE_CNT /**/ #endif /* USE_STDIO_BASE: diff --git a/vos/config_h.SH_orig b/vos/config_h.SH_orig index a209e6d..e34d920 100755 --- a/vos/config_h.SH_orig +++ b/vos/config_h.SH_orig @@ -2048,12 +2048,23 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un * This symbol is defined if the FILE_cnt macro can be used as an * lvalue. */ +/* STDIO_PTR_LVAL_SETS_CNT: + * This symbol is defined if using the FILE_ptr macro as an lvalue + * to increase the pointer by n has the side effect of decreasing the + * value of File_cnt(fp) by n. + */ +/* STDIO_PTR_LVAL_NOCHANGE_CNT: + * This symbol is defined if using the FILE_ptr macro as an lvalue + * to increase the pointer by n leaves File_cnt(fp) unchanged. + */ #$d_stdstdio USE_STDIO_PTR /**/ #ifdef USE_STDIO_PTR #define FILE_ptr(fp) $stdio_ptr #$d_stdio_ptr_lval STDIO_PTR_LVALUE /**/ #define FILE_cnt(fp) $stdio_cnt #$d_stdio_cnt_lval STDIO_CNT_LVALUE /**/ +#$d_stdio_ptr_lval_sets_cnt STDIO_PTR_LVAL_SETS_CNT /**/ +#$d_stdio_ptr_lval_nochange_cnt STDIO_PTR_LVAL_NOCHANGE_CNT /**/ #endif /* USE_STDIO_BASE: diff --git a/win32/config.bc b/win32/config.bc index 097d429..afc148c 100644 --- a/win32/config.bc +++ b/win32/config.bc @@ -319,6 +319,8 @@ d_statfs_s='undef' d_statvfs='undef' d_stdio_cnt_lval='define' d_stdio_ptr_lval='define' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_ptr_lval_nochange_cnt='undef' d_stdio_stream_array='undef' d_stdiobase='define' d_stdstdio='define' diff --git a/win32/config.gc b/win32/config.gc index 9251b24..b196486 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -319,6 +319,8 @@ d_statfs_s='undef' d_statvfs='undef' d_stdio_cnt_lval='define' d_stdio_ptr_lval='define' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_ptr_lval_nochange_cnt='undef' d_stdio_stream_array='undef' d_stdiobase='define' d_stdstdio='define' diff --git a/win32/config.vc b/win32/config.vc index 61558e5..071b464 100644 --- a/win32/config.vc +++ b/win32/config.vc @@ -319,6 +319,8 @@ d_statfs_s='undef' d_statvfs='undef' d_stdio_cnt_lval='define' d_stdio_ptr_lval='define' +d_stdio_ptr_lval_sets_cnt='undef' +d_stdio_ptr_lval_nochange_cnt='undef' d_stdio_stream_array='undef' d_stdiobase='define' d_stdstdio='define'