Subject: | Won't build on Windows |
With the attached patches applied, Math-Int64-0.03 builds and tests
fine for me on Win32, irrespective of whether I use Visual Studio or
MinGW as the compiler.
I have Windows Vista 64, and the same patches also allow Math-Int64-
0.03 to build on my 64-bit build of ActivePerl (where I'm using a 64-
bit SDK compiler).
Faik, there may be a better fix for Windows than the patches I've
supplied ... and I haven't tested Math::Int64 beyond what's provided by
the test suite.
Cheers,
Rob
Subject: | Makefile.PL.patch |
--- Makefile.PL_orig Sun Sep 28 10:24:13 2008
+++ Makefile.PL Sun Sep 28 12:33:26 2008
@@ -18,10 +18,12 @@
# we force the DOUBLE backend for the moment...
$backend = 'DOUBLE';
-unless ($Config::Config{i64type} and
- $Config::Config{d_int64_t} and
- $Config::Config{i64size} == 8) {
- die "Your C compiler does not have enough support for int64 values\n";
+unless ($^O =~ /MSWin32/i && ($Config::Config{cc} eq 'cl' || $Config::Config{cc} eq 'gcc')) {
+ unless ($Config::Config{i64type} and
+ $Config::Config{d_int64_t} and
+ $Config::Config{i64size} == 8) {
+ die "Your C compiler does not have enough support for int64 values\n";
+ }
}
my @define = ("INT64_BACKEND_" . $backend);
Subject: | Int64.xs.patch |
--- Int64.xs_orig Sun Sep 28 10:24:28 2008
+++ Int64.xs Sun Sep 28 12:27:50 2008
@@ -11,6 +11,21 @@
static HV *package_int64_stash;
static HV *package_uint64_stash;
+#ifdef __MINGW32__
+#include <stdint.h>
+#include <stdlib.h>
+#define INT64_HAS_ATOLL
+#endif
+
+#ifdef _MSC_VER
+#include <stdlib.h>
+#define INT64_HAS_ATOLL
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#define atoll _atoi64
+#define strtoull _strtoui64
+#endif
+
#if !defined(INT64_HAS_ATOLL)
# if defined(INT64_HAS_STRTOLL)
# define atoll(x) strtoll((x), NULL, 10)