diff options
author | Craig A. Berry <craigberry@mac.com> | 2002-06-13 14:55:25 -0500 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2002-06-14 00:39:15 +0000 |
commit | baf3cf9c09c529e1ab56c4c24a7a8bb4dba12542 (patch) | |
tree | 30dd5fb45302039764ae059daee7e8068abcb059 /pp_pack.c | |
parent | 5e549d84d4e12bde1231ea210b2b8fef16250d07 (diff) | |
download | perl-baf3cf9c09c529e1ab56c4c24a7a8bb4dba12542.tar.gz |
assorted help for older VMS systems
From: "Craig A. Berry" <craigberry@mac.com>
Message-Id: <a05111b05b92ec91d165b@[172.16.52.1]>
p4raw-link: @17206 on //depot/perl: c5d9854390e492eb0f0360555ff8df0dad92cc9c
p4raw-id: //depot/perl@17227
Diffstat (limited to 'pp_pack.c')
-rw-r--r-- | pp_pack.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -2101,7 +2101,18 @@ Perl_pack_cat(pTHX_ SV *cat, char *pat, register char *patend, register SV **beg afloat = _float_constants[0]; /* single prec. inf. */ else afloat = (float)SvNV(fromstr); #else +# if defined(VMS) && !defined(__IEEE_FP) +/* IEEE fp overflow shenanigans are unavailable on VAX and optional + * on Alpha; fake it if we don't have them. + */ + if (SvNV(fromstr) > FLT_MAX) + afloat = FLT_MAX; + else if (SvNV(fromstr) < -FLT_MAX) + afloat = -FLT_MAX; + else afloat = (float)SvNV(fromstr); +# else afloat = (float)SvNV(fromstr); +# endif #endif sv_catpvn(cat, (char *)&afloat, sizeof (float)); } @@ -2122,7 +2133,18 @@ Perl_pack_cat(pTHX_ SV *cat, char *pat, register char *patend, register SV **beg adouble = _double_constants[0]; /* double prec. inf. */ else adouble = (double)SvNV(fromstr); #else +# if defined(VMS) && !defined(__IEEE_FP) +/* IEEE fp overflow shenanigans are unavailable on VAX and optional + * on Alpha; fake it if we don't have them. + */ + if (SvNV(fromstr) > DBL_MAX) + adouble = DBL_MAX; + else if (SvNV(fromstr) < -DBL_MAX) + adouble = -DBL_MAX; + else adouble = (double)SvNV(fromstr); +# else adouble = (double)SvNV(fromstr); +# endif #endif sv_catpvn(cat, (char *)&adouble, sizeof (double)); } |