Codebase list libmath-int64-perl / fb22276
warn when both die_on_overflow and native_if_available are enabled Salvador Fandino 9 years ago
4 changed file(s) with 20 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
00 Revision history for Perl extension Math::Int64.
11
22 {{$NEXT}}
3 - warn when both native_if_available and die_on_overflow are
4 enabled (bug report by David Wheeler).
35
46 0.52 2015-03-12
57 - include stdint.h when compiling with recent MS compilers
22 use strict;
33 use warnings;
44
5 use Math::Int64 ();
6
57 sub import {
68 require Math::Int64;
79 Math::Int64::_set_may_die_on_overflow(1);
8 $^H{'Math::Int64::die_on_overflow'} = 1
10 $^H{'Math::Int64::die_on_overflow'} = 1;
11 goto &Math::Int64::_check_pragma_compatibility;
912 }
1013
1114
22 use strict;
33 use warnings;
44
5 use Math::Int64 ();
6
57 sub import {
68 if (Math::Int64::_backend() eq 'IV' and $] >= 5.008) {
79 Math::Int64::_set_may_use_native(1);
810 $^H{'Math::Int64::native_if_available'} = 1;
11 goto &Math::Int64::_check_pragma_compatibility;
912 }
1013 }
1114
77 require XSLoader;
88 XSLoader::load('Math::Int64', $VERSION);
99 }
10
11 use warnings::register;
1012
1113 use constant MAX_INT64 => string_to_int64 ( '0x7fff_ffff_ffff_ffff');
1214 use constant MIN_INT64 => string_to_int64 ('-0x8000_0000_0000_0000');
6163 }
6264
6365 Math::Int64->export_to_level(1, $pkg, @subs);
66 }
67
68 sub _check_pragma_compatibility {
69 if ($^H{'Math::Int64::native_if_available'} and
70 $^H{'Math::Int64::die_on_overflow'} and
71 warnings::enabled()) {
72 warnings::warn("Math::Int64::die_on_overflow pragma is useless when Math::Int64::native_if_available is also active");
73 }
74 1;
6475 }
6576
6677 use overload ( '+' => \&_add,