Subject: | gcc 4.4 support |
Hi,
Please find enclosed patch that adds support for (some) gcc 4.4.x compilers.
Info about 128-bit types support in gcc 4.4 - see http://gcc.gnu.org/gcc-4.4/changes.html
--
kmx
Please find enclosed patch that adds support for (some) gcc 4.4.x compilers.
Info about 128-bit types support in gcc 4.4 - see http://gcc.gnu.org/gcc-4.4/changes.html
--
kmx
Subject: | gcc-4.4-patch.diff |
diff -ru Math-Int128-0.04.orig\Int128.xs Math-Int128-0.04\Int128.xs
--- Math-Int128-0.04.orig\Int128.xs Tue Feb 15 15:19:46 2011
+++ Math-Int128-0.04\Int128.xs Thu Apr 21 09:40:24 2011
@@ -8,11 +8,14 @@
#include "ppport.h"
+#if __GNUC__ == 4 && __GNUC_MINOR__ >= 4 && __GNUC_MINOR__ < 6
+/* workaroung for gcc 4.4/4.5 - see http://gcc.gnu.org/gcc-4.4/changes.html */
+typedef int int128_t __attribute__ ((__mode__ (TI)));
+typedef unsigned int uint128_t __attribute__ ((__mode__ (TI)));
+#else
typedef __int128 int128_t;
typedef unsigned __int128 uint128_t;
-
-//typedef long long int128_t;
-//typedef unsigned long long uint128_t;
+#endif
#define I128LEN sizeof(int128_t)
diff -ru Math-Int128-0.04.orig\Makefile.PL Math-Int128-0.04\Makefile.PL
--- Math-Int128-0.04.orig\Makefile.PL Tue Mar 08 18:18:18 2011
+++ Math-Int128-0.04\Makefile.PL Thu Apr 21 09:38:16 2011
@@ -15,9 +15,9 @@
my $cc = (grep defined, $mm->{CC}, $onfig{cc}, 'cc')[0];
my $cc_version = `$cc --version`;
-unless ($cc_version =~ /cc\s+\([^)]*\)\s+4\.(\d+)/i and $1 >= 6) {
+unless ($cc_version =~ /cc\s+\([^)]*\)\s+4\.(\d+)/i and $1 >= 4) {
unlink $mm->{MAKEFILE};
- die "This module requires version 4.6 or above of the GCC compiler.\nAborting!\n\n"
+ die "This module requires version 4.4 or above of the GCC compiler.\nAborting!\n\n"
}