From: Dominic Dunlop Date: Mon, 20 Nov 2000 18:55:29 +0000 (+0100) Subject: Re: Not OK: perl5.7.0 +DEVEL7706 +Duseperlio on AIX4.[23] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2cc61e15d3dcd28f355bee01f2fb06b42ba7309f;p=p5sagit%2Fp5-mst-13.2.git Re: Not OK: perl5.7.0 +DEVEL7706 +Duseperlio on AIX4.[23] Message-Id: va_copy() and the need of it. See . p4raw-id: //depot/perl@7793 --- diff --git a/Configure b/Configure index 5ea281a..f4709a2 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 Nov 16 16:33:41 EET 2000 [metaconfig 3.0 PL70] +# Generated on Tue Nov 21 20:33:35 EET 2000 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >/tmp/c1$$ < found." >&4 + valstd="$define" +else + echo " NOT found." >&4 + valstd="$undef" +fi + +: see if varags is available +echo " " +if $test `./findhdr varargs.h`; then + echo " found." >&4 +else + echo " NOT found, but that's ok (I hope)." >&4 +fi + +: set up the varargs testing programs +$cat > varargs.c < +#endif +#ifdef I_VARARGS +#include +#endif + +#ifdef I_STDARG +int f(char *p, ...) +#else +int f(va_alist) +va_dcl +#endif +{ + va_list ap; +#ifndef I_STDARG + char *p; +#endif +#ifdef I_STDARG + va_start(ap,p); +#else + va_start(ap); + p = va_arg(ap, char *); +#endif + va_end(ap); +} +EOP +$cat > varargs </dev/null 2>&1; then + echo "true" +else + echo "false" +fi +$rm -f varargs$_o +EOP +chmod +x varargs + +: now check which varargs header should be included +echo " " +i_varhdr='' +case "$valstd" in +"$define") + if `./varargs I_STDARG`; then + val='stdarg.h' + elif `./varargs I_VARARGS`; then + val='varargs.h' + fi + ;; +*) + if `./varargs I_VARARGS`; then + val='varargs.h' + fi + ;; +esac +case "$val" in +'') +echo "I could not find the definition for va_dcl... You have problems..." >&4 + val="$undef"; set i_stdarg; eval $setvar + val="$undef"; set i_varargs; eval $setvar + ;; +*) + set i_varhdr + eval $setvar + case "$i_varhdr" in + stdarg.h) + val="$define"; set i_stdarg; eval $setvar + val="$undef"; set i_varargs; eval $setvar + ;; + varargs.h) + val="$undef"; set i_stdarg; eval $setvar + val="$define"; set i_varargs; eval $setvar + ;; + esac + echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; +esac +$rm -f varargs* + +: see if we need va_copy +echo " " +case "$i_stdarg" in +"$define") + $cat >try.c < +#include + +int +ivfprintf(FILE *f, const char *fmt, va_list *valp) +{ + return vfprintf(f, fmt, *valp); +} + +int +myvfprintf(FILE *f, const char *fmt, va_list val) +{ + return ivfprintf(f, fmt, &val); +} + +int +myprintf(char *fmt, ...) +{ + va_list val; + va_start(val, fmt); + return myvfprintf(stdout, fmt, val); +} + +int +main(int ac, char **av) +{ + myprintf("%s%cs all right, then\n", "that", '\''); + exit(0); +} +EOCP + set try + if eval $compile_ok && ./try >/dev/null; then + case "`./try`" in + "that's all right, then") + okay=yes + ;; + esac + fi + case "$okay" in + yes) echo "It seems that you don't need va_copy()." >&4 + need_va_copy="$undef" + ;; + *) echo "It seems that va_copy() or similar will be needed." >&4 + need_va_copy="$define" + ;; + esac + $rm -f try.* core core.* *.core *.core.* + ;; +*) echo "You don't have , not checking for va_copy()." >&4 + ;; +esac + : define a fucntion to check prototypes $cat > protochk < found." >&4 - valstd="$define" -else - echo " NOT found." >&4 - valstd="$undef" -fi - -: see if varags is available -echo " " -if $test `./findhdr varargs.h`; then - echo " found." >&4 -else - echo " NOT found, but that's ok (I hope)." >&4 -fi - -: set up the varargs testing programs -$cat > varargs.c < -#endif -#ifdef I_VARARGS -#include -#endif - -#ifdef I_STDARG -int f(char *p, ...) -#else -int f(va_alist) -va_dcl -#endif -{ - va_list ap; -#ifndef I_STDARG - char *p; -#endif -#ifdef I_STDARG - va_start(ap,p); -#else - va_start(ap); - p = va_arg(ap, char *); -#endif - va_end(ap); -} -EOP -$cat > varargs </dev/null 2>&1; then - echo "true" -else - echo "false" -fi -$rm -f varargs$_o -EOP -chmod +x varargs - -: now check which varargs header should be included -echo " " -i_varhdr='' -case "$valstd" in -"$define") - if `./varargs I_STDARG`; then - val='stdarg.h' - elif `./varargs I_VARARGS`; then - val='varargs.h' - fi - ;; -*) - if `./varargs I_VARARGS`; then - val='varargs.h' - fi - ;; -esac -case "$val" in -'') -echo "I could not find the definition for va_dcl... You have problems..." >&4 - val="$undef"; set i_stdarg; eval $setvar - val="$undef"; set i_varargs; eval $setvar - ;; -*) - set i_varhdr - eval $setvar - case "$i_varhdr" in - stdarg.h) - val="$define"; set i_stdarg; eval $setvar - val="$undef"; set i_varargs; eval $setvar - ;; - varargs.h) - val="$undef"; set i_stdarg; eval $setvar - val="$define"; set i_varargs; eval $setvar - ;; - esac - echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; -esac -$rm -f varargs* - : see if stddef is available set stddef.h i_stddef eval $inhdr @@ -16047,6 +16105,7 @@ mydomain='$mydomain' myhostname='$myhostname' myuname='$myuname' n='$n' +need_va_copy='$need_va_copy' netdb_hlen_type='$netdb_hlen_type' netdb_host_type='$netdb_host_type' netdb_name_type='$netdb_name_type' diff --git a/Porting/Glossary b/Porting/Glossary index 2233779..c4ce3de 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -2740,6 +2740,15 @@ n (n.U): command to suppress newline. Otherwise it is null. Correct usage is $echo $n "prompt for a question: $c". +need_va_copy (need_va_copy.U): + This symbol, if defined, indicates that the system stores + the variable argument list datatype, va_list, in a format + that cannot be copied by simple assignment, so that some + other means must be used when copying is required. + As such systems vary in their provision (or non-provision) + of copying mechanisms, handy.h defines a platform- + independent macro, Perl_va_copy(src, dst), to do the job. + netdb_hlen_type (netdbtype.U): This variable holds the type used for the 2nd argument to gethostbyaddr(). Usually, this is int or size_t or unsigned. diff --git a/Porting/config.sh b/Porting/config.sh index 9e0e300..2f760ae 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: Thu Nov 16 16:43:36 EET 2000 +# Configuration time: Tue Nov 21 20:44:07 EET 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='Thu Nov 16 16:43:36 EET 2000' +cf_time='Tue Nov 21 20:44:07 EET 2000' charsize='1' chgrp='' chmod='' @@ -608,6 +608,7 @@ mydomain='.yourplace.com' myhostname='yourhost' myuname='osf1 alpha.hut.fi v4.0 878 alpha ' n='' +need_va_copy='undef' netdb_hlen_type='int' netdb_host_type='const char *' netdb_name_type='const char *' diff --git a/Porting/config_H b/Porting/config_H index 59537cb..10130c2 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: Thu Nov 16 16:43:36 EET 2000 + * Configuration time: Tue Nov 21 20:44:07 EET 2000 * Configured by : jhi * Target system : osf1 alpha.hut.fi v4.0 878 alpha */ @@ -3220,4 +3220,15 @@ */ #define HAS_SBRK_PROTO /**/ +/* NEED_VA_COPY: + * This symbol, if defined, indicates that the system stores + * the variable argument list datatype, va_list, in a format + * that cannot be copied by simple assignment, so that some + * other means must be used when copying is required. + * As such systems vary in their provision (or non-provision) + * of copying mechanisms, handy.h defines a platform- + * independent macro, Perl_va_copy(src, dst), to do the job. + */ +/*#define NEED_VA_COPY / **/ + #endif diff --git a/config_h.SH b/config_h.SH index f912151..6483ebe 100644 --- a/config_h.SH +++ b/config_h.SH @@ -3240,5 +3240,16 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$d_sbrkproto HAS_SBRK_PROTO /**/ +/* NEED_VA_COPY: + * This symbol, if defined, indicates that the system stores + * the variable argument list datatype, va_list, in a format + * that cannot be copied by simple assignment, so that some + * other means must be used when copying is required. + * As such systems vary in their provision (or non-provision) + * of copying mechanisms, handy.h defines a platform- + * independent macro, Perl_va_copy(src, dst), to do the job. + */ +#$need_va_copy NEED_VA_COPY /**/ + #endif !GROK!THIS! diff --git a/configure.com b/configure.com index 0946503..52464fe 100644 --- a/configure.com +++ b/configure.com @@ -5190,6 +5190,7 @@ $ WC "multiarch='undef'" $ WC "mydomain='" + mydomain + "'" $ WC "myhostname='" + myhostname + "'" $ WC "myuname='" + myuname + "'" +$ WC "need_va_copy='undef'" $ WC "netdb_hlen_type='" + netdb_hlen_type + "'" $ WC "netdb_host_type='" + netdb_host_type + "'" $ WC "netdb_name_type='" + netdb_name_type + "'" diff --git a/epoc/config.sh b/epoc/config.sh index 9595c0c..2ea89c1 100644 --- a/epoc/config.sh +++ b/epoc/config.sh @@ -573,6 +573,7 @@ mydomain='.gmx.de' myhostname='dragon' myuname='' n='-n' +need_va_copy='undef' netdb_hlen_type='int' netdb_host_type='const char *' netdb_name_type='const char *' diff --git a/handy.h b/handy.h index b3912a4..32cab66 100644 --- a/handy.h +++ b/handy.h @@ -623,3 +623,14 @@ extern long lastxycount[MAXXCOUNT][MAXYCOUNT]; #else #define StructCopy(s,d,t) Copy(s,d,1,t) #endif + +#ifdef NEED_VA_COPY +# ifdef va_copy +# define Perl_va_copy(s, d) va_copy(d, s) +# elif defined(__va_copy) +# define Perl_va_copy(s, d) __va_copy(d, s) +# else +# define Perl_va_copy(s, d) Copy(s, d, 1, va_list) +# endif +#endif + diff --git a/perlio.c b/perlio.c index 7f2d66f..0c2e256 100644 --- a/perlio.c +++ b/perlio.c @@ -2305,7 +2305,13 @@ PerlIO_vprintf(PerlIO *f, const char *fmt, va_list ap) SV *sv = newSVpvn("",0); char *s; STRLEN len; +#ifdef NEED_VA_COPY + va_list apc; + Perl_va_copy(ap, apc); + sv_vcatpvf(sv, fmt, &apc); +#else sv_vcatpvf(sv, fmt, &ap); +#endif s = SvPV(sv,len); return PerlIO_write(f,s,len); } diff --git a/pod/perltoc.pod b/pod/perltoc.pod index 4133ccc..b34ecd6 100644 --- a/pod/perltoc.pod +++ b/pod/perltoc.pod @@ -3809,7 +3809,7 @@ C, C, C =item The & Unary Operator -=item Inserting Comments and C Preprocessor Directives +=item Inserting POD, Comments and C Preprocessor Directives =item Using XS With C++ @@ -4590,16 +4590,9 @@ work?, Patches speak louder than words =item Keeping in sync rsync'ing the source tree, Using rsync over the LAN, Using pushing over the -NFS, rsync'ing the patches - -=item Why rsync the source tree - -It's easier, It's more recent, It's more reliable - -=item Why rsync the patches - -It's easier, It's a good reference, Finding a start point, Finding how to -fix a bug, Finding the source of misbehaviour +NFS, rsync'ing the patches, It's easier, It's more recent, It's more +reliable, It's easier, It's a good reference, Finding a start point, +Finding how to fix a bug, Finding the source of misbehaviour =item Submitting patches @@ -7966,7 +7959,7 @@ on first try?, 8) In our intranet we have many modules for internal use. How can I integrate these modules with CPAN.pm but without uploading the modules to CPAN?, 9) When I run CPAN's shell, I get error msg about line 1 to 4, setting meta input/output via the /etc/inputrc -file +file, 10) Some authors have strange characters in their names =item BUGS @@ -8106,11 +8099,11 @@ C, C, C, C, C =item d -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, @@ -8148,32 +8141,33 @@ C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, -C, C, C, C, -C, C, C, C, C, -C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, -C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, -C, C, C, -C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, -C, C, C, C, C +C, C, C, C, +C, C, C, C, C, +C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, +C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, +C, C, C, C, +C, C, C, C, +C, C, +C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C =item e @@ -9680,6 +9674,40 @@ C, C =back +=head2 File::Spec::Epoc - methods for Epoc file specs + +=over 4 + +=item SYNOPSIS + +=item DESCRIPTION + +devnull + +=back + +tmpdir + +path + +canonpath + +splitpath + +splitdir + +catpath + +abs2rel + +rel2abs + +=over 4 + +=item SEE ALSO + +=back + =head2 File::Spec::Functions - portably perform operations on file names =over 4 diff --git a/uconfig.h b/uconfig.h index a00eed1..8d25c1c 100644 --- a/uconfig.h +++ b/uconfig.h @@ -3216,4 +3216,15 @@ */ /*#define HAS_SBRK_PROTO / **/ +/* NEED_VA_COPY: + * This symbol, if defined, indicates that the system stores + * the variable argument list datatype, va_list, in a format + * that cannot be copied by simple assignment, so that some + * other means must be used when copying is required. + * As such systems vary in their provision (or non-provision) + * of copying mechanisms, handy.h defines a platform- + * independent macro, Perl_va_copy(src, dst), to do the job. + */ +/*#define NEED_VA_COPY / **/ + #endif diff --git a/uconfig.sh b/uconfig.sh index ca27412..0c8dffc 100755 --- a/uconfig.sh +++ b/uconfig.sh @@ -431,6 +431,7 @@ modetype=int multiarch='undef' myarchname='unknown' myuname='unknown' +need_va_copy='undef' netdb_hlen_type='int' netdb_host_type='const char *' netdb_name_type='const char *' diff --git a/vos/config.alpha.def b/vos/config.alpha.def index 5a88cb8..92ac457 100644 --- a/vos/config.alpha.def +++ b/vos/config.alpha.def @@ -398,6 +398,7 @@ $mmaptype='void *' $modetype='mode_t' $multiarch='undef' $myuname='VOS' +$need_va_copy='undef' $netdb_hlen_type='int' $netdb_host_type='char *' $netdb_name_type='char *' diff --git a/vos/config.alpha.h b/vos/config.alpha.h index f4d8392..6344668 100644 --- a/vos/config.alpha.h +++ b/vos/config.alpha.h @@ -3216,4 +3216,15 @@ /*#define HAS_SETPGRP /**/ /*#define USE_BSD_SETPGRP /**/ +/* NEED_VA_COPY: + * This symbol, if defined, indicates that the system stores + * the variable argument list datatype, va_list, in a format + * that cannot be copied by simple assignment, so that some + * other means must be used when copying is required. + * As such systems vary in their provision (or non-provision) + * of copying mechanisms, handy.h defines a platform- + * independent macro, Perl_va_copy(src, dst), to do the job. + */ +/*#define NEED_VA_COPY / **/ + #endif diff --git a/vos/config.ga.def b/vos/config.ga.def index c041b5c..f694977 100644 --- a/vos/config.ga.def +++ b/vos/config.ga.def @@ -398,6 +398,7 @@ $mmaptype='void *' $modetype='mode_t' $multiarch='undef' $myuname='VOS' +$need_va_copy='undef' $netdb_hlen_type='int' $netdb_host_type='char *' $netdb_name_type='char *' diff --git a/vos/config.ga.h b/vos/config.ga.h index 2fdc4a8..834764a 100644 --- a/vos/config.ga.h +++ b/vos/config.ga.h @@ -3216,4 +3216,15 @@ /*#define HAS_SETPGRP /**/ /*#define USE_BSD_SETPGRP /**/ +/* NEED_VA_COPY: + * This symbol, if defined, indicates that the system stores + * the variable argument list datatype, va_list, in a format + * that cannot be copied by simple assignment, so that some + * other means must be used when copying is required. + * As such systems vary in their provision (or non-provision) + * of copying mechanisms, handy.h defines a platform- + * independent macro, Perl_va_copy(src, dst), to do the job. + */ +/*#define NEED_VA_COPY / **/ + #endif diff --git a/win32/config.bc b/win32/config.bc index 04d5f45..e171ab8 100644 --- a/win32/config.bc +++ b/win32/config.bc @@ -604,6 +604,7 @@ mydomain='' myhostname='' myuname='' n='-n' +need_va_copy='undef' netdb_hlen_type='int' netdb_host_type='char *' netdb_name_type='char *' diff --git a/win32/config.gc b/win32/config.gc index 4bf0d95..aa2d188 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -604,6 +604,7 @@ mydomain='' myhostname='' myuname='' n='-n' +need_va_copy='undef' netdb_hlen_type='int' netdb_host_type='char *' netdb_name_type='char *' diff --git a/win32/config.vc b/win32/config.vc index 489cdd0..a320bf1 100644 --- a/win32/config.vc +++ b/win32/config.vc @@ -604,6 +604,7 @@ mydomain='' myhostname='' myuname='' n='-n' +need_va_copy='undef' netdb_hlen_type='int' netdb_host_type='char *' netdb_name_type='char *'