X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl.h;h=ece27a2ebedc0e7171a6d220c0c3b6a2ffbb1dc6;hb=aacdac464b116367cebe4e1e19fd4b760789bbdf;hp=a84534c84dec3e41499490e4ca64999d33e6c040;hpb=80814d4c448093ff1bbffc8303aa2b382c1caa70;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perl.h b/perl.h index a84534c..ece27a2 100644 --- a/perl.h +++ b/perl.h @@ -1164,6 +1164,18 @@ typedef NVTYPE NV; # ifdef LDBL_MANT_DIG # define NV_MANT_DIG LDBL_MANT_DIG # endif +# ifdef LDBL_MAX +# define NV_MAX LDBL_MAX +# define NV_MIN LDBL_MIN +# else +# ifdef HUGE_VALL +# define NV_MAX HUGE_VALL +# else +# ifdef HUGE_VAL +# define NV_MAX ((NV)HUGE_VAL) +# endif +# endif +# endif # ifdef HAS_SQRTL # define Perl_cos cosl # define Perl_sin sinl @@ -1200,6 +1212,14 @@ typedef NVTYPE NV; # ifdef DBL_MANT_DIG # define NV_MANT_DIG DBL_MANT_DIG # endif +# ifdef DBL_MAX +# define NV_MAX DBL_MAX +# define NV_MIN DBL_MIN +# else +# ifdef HUGE_VAL +# define NV_MAX HUGE_VAL +# endif +# endif # define Perl_cos cos # define Perl_sin sin # define Perl_sqrt sqrt @@ -1220,15 +1240,22 @@ typedef NVTYPE NV; #if !defined(Perl_atof) && defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) # if !defined(Perl_atof) && defined(HAS_STRTOLD) -# define Perl_atof(s) strtold(s, (char**)NULL) +# define Perl_atof(s) (NV)strtold(s, (char**)NULL) # endif # if !defined(Perl_atof) && defined(HAS_ATOLF) -# define Perl_atof atolf +# define Perl_atof (NV)atolf +# endif +# if !defined(Perl_atof) && defined(PERL_SCNfldbl) +# define Perl_atof PERL_SCNfldbl +# define Perl_atof2(s,f) sscanf((s), "%"PERL_SCNfldbl, &(f)) # endif #endif #if !defined(Perl_atof) # define Perl_atof atof /* we assume atof being available anywhere */ #endif +#if !defined(Perl_atof2) +# define Perl_atof2(s,f) ((f) = (NV)Perl_atof(s)) +#endif /* Previously these definitions used hardcoded figures. * It is hoped these formula are more portable, although @@ -1401,25 +1428,10 @@ typedef NVTYPE NV; #ifdef UV_IS_QUAD -# ifdef UQUAD_MAX -# define PERL_UQUAD_MAX ((UV)UQUAD_MAX) -# else # define PERL_UQUAD_MAX (~(UV)0) -# endif - -# define PERL_UQUAD_MIN ((UV)0) - -# ifdef QUAD_MAX -# define PERL_QUAD_MAX ((IV)QUAD_MAX) -# else +# define PERL_UQUAD_MIN ((UV)0) # define PERL_QUAD_MAX ((IV) (PERL_UQUAD_MAX >> 1)) -# endif - -# ifdef QUAD_MIN -# define PERL_QUAD_MIN ((IV)QUAD_MIN) -# else # define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3)) -# endif #endif @@ -2238,7 +2250,7 @@ typedef OP* (CPERLscope(*PPADDR_t)[]) (pTHX); # define environ (*environ_pointer) EXT char *** environ_pointer; # else -# if defined(__APPLE__) +# if defined(__APPLE__) && defined(PERL_CORE) # include /* for the env array */ # define environ (*_NSGetEnviron()) # endif @@ -2589,7 +2601,6 @@ enum { /* pass one of these to get_vtbl */ #define HINT_NEW_STRING 0x00008000 #define HINT_NEW_RE 0x00010000 #define HINT_LOCALIZE_HH 0x00020000 /* %^H needs to be copied */ -#define HINT_CT_MRESOLVE 0x00040000 /* resolve methods at compile time */ #define HINT_RE_TAINT 0x00100000 #define HINT_RE_EVAL 0x00200000 @@ -2868,7 +2879,8 @@ EXT MGVTBL PL_vtbl_defelem = {MEMBER_TO_FPTR(Perl_magic_getdefelem),MEMBER_TO_FP EXT MGVTBL PL_vtbl_regexp = {0,0,0,0, MEMBER_TO_FPTR(Perl_magic_freeregexp)}; EXT MGVTBL PL_vtbl_regdata = {0, 0, MEMBER_TO_FPTR(Perl_magic_regdata_cnt), 0, 0}; -EXT MGVTBL PL_vtbl_regdatum = {MEMBER_TO_FPTR(Perl_magic_regdatum_get), 0, 0, 0, 0}; +EXT MGVTBL PL_vtbl_regdatum = {MEMBER_TO_FPTR(Perl_magic_regdatum_get), + MEMBER_TO_FPTR(Perl_magic_regdatum_set), 0, 0, 0}; #ifdef USE_LOCALE_COLLATE EXT MGVTBL PL_vtbl_collxfrm = {0, @@ -3111,8 +3123,20 @@ typedef struct am_table_short AMTS; ((PL_hints & HINT_LOCALE) && \ PL_numeric_radix && (c) == PL_numeric_radix) -#define RESTORE_NUMERIC_LOCAL() if ((PL_hints & HINT_LOCALE) && PL_numeric_standard) SET_NUMERIC_LOCAL() -#define RESTORE_NUMERIC_STANDARD() if ((PL_hints & HINT_LOCALE) && PL_numeric_local) SET_NUMERIC_STANDARD() +#define STORE_NUMERIC_LOCAL_SET_STANDARD() \ + bool was_local = (PL_hints & HINT_LOCALE) && PL_numeric_local; \ + if (!was_local) SET_NUMERIC_STANDARD(); + +#define STORE_NUMERIC_STANDARD_SET_LOCAL() \ + bool was_standard = !(PL_hints & HINT_LOCALE) || PL_numeric_standard; \ + if (!was_standard) SET_NUMERIC_LOCAL(); + +#define RESTORE_NUMERIC_LOCAL() \ + if (was_local) SET_NUMERIC_LOCAL(); + +#define RESTORE_NUMERIC_STANDARD() \ + if (was_standard) SET_NUMERIC_STANDARD(); + #define Atof my_atof #else /* !USE_LOCALE_NUMERIC */ @@ -3120,6 +3144,8 @@ typedef struct am_table_short AMTS; #define SET_NUMERIC_STANDARD() /**/ #define SET_NUMERIC_LOCAL() /**/ #define IS_NUMERIC_RADIX(c) (0) +#define STORE_NUMERIC_LOCAL_SET_STANDARD() /**/ +#define STORE_NUMERIC_STANDARD_SET_LOCAL() /**/ #define RESTORE_NUMERIC_LOCAL() /**/ #define RESTORE_NUMERIC_STANDARD() /**/ #define Atof Perl_atof @@ -3340,6 +3366,10 @@ typedef struct am_table_short AMTS; #endif /* IAMSUID */ +#ifdef I_LIBUTIL +# include /* setproctitle() in some FreeBSDs */ +#endif + /* and finally... */ #define PERL_PATCHLEVEL_H_IMPLICIT #include "patchlevel.h" @@ -3366,6 +3396,10 @@ typedef struct am_table_short AMTS; I_SYSMMAN Mmap_t + NVef + NVff + NVgf + so that Configure picks them up. */ #endif /* Include guard */