[Pkg-ocaml-maint-commits] [SCM] ocaml-bitstring packaging branch, master, updated. debian/2.0.0-3-1-gbe18382
Stephane Glondu
steph at glondu.net
Fri Jul 10 12:08:14 UTC 2009
The following commit has been merged in the master branch:
commit be1838209d4a8deb60fc532edae0e96a4fd8923a
Author: Stephane Glondu <steph at glondu.net>
Date: Fri Jul 10 13:59:48 2009 +0200
Add fix_ARCH_ALIGN_INT64.dpatch
diff --git a/debian/changelog b/debian/changelog
index 81986b1..e6256e9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ocaml-bitstring (2.0.0-4) UNRELEASED; urgency=low
+
+ * Add patch to fix FTBFS on ARCH_ALIGN_INT64 architectures (hppa, sparc)
+
+ -- Stephane Glondu <steph at glondu.net> Fri, 10 Jul 2009 14:00:32 +0200
+
ocaml-bitstring (2.0.0-3) unstable; urgency=low
* Fix only-bytecode former upload
diff --git a/debian/patches/fix_ARCH_ALIGN_INT64.dpatch b/debian/patches/fix_ARCH_ALIGN_INT64.dpatch
new file mode 100644
index 0000000..c081957
--- /dev/null
+++ b/debian/patches/fix_ARCH_ALIGN_INT64.dpatch
@@ -0,0 +1,57 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## fix_ARCH_ALIGN_INT64.dpatch by Stephane Glondu <steph at glondu.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix C bindings on ARCH_ALIGN_INT64 architectures (hppa, sparc)
+
+ at DPATCH@
+--- a/bitstring_c.c
++++ b/bitstring_c.c
+@@ -86,8 +86,6 @@ fastpath1(16,be,signed,int16_t)
+ fastpath1(16,le,signed,int16_t)
+ fastpath1(16,ne,signed,int16_t)
+
+-/* XXX This probably doesn't work on ARCH_ALIGN_INT64 platforms. */
+-
+ #define fastpath2(size,endian,signed,type,rval) \
+ CAMLprim value \
+ ocaml_bitstring_extract_fastpath_int##size##_##endian##_##signed \
+@@ -108,9 +106,32 @@ fastpath2(32,be,signed,int32_t,Int32_val)
+ fastpath2(32,le,signed,int32_t,Int32_val)
+ fastpath2(32,ne,signed,int32_t,Int32_val)
+
+-fastpath2(64,be,unsigned,uint64_t,Int64_val)
+-fastpath2(64,le,unsigned,uint64_t,Int64_val)
+-fastpath2(64,ne,unsigned,uint64_t,Int64_val)
+-fastpath2(64,be,signed,int64_t,Int64_val)
+-fastpath2(64,le,signed,int64_t,Int64_val)
+-fastpath2(64,ne,signed,int64_t,Int64_val)
++/* Special care needs to be taken on ARCH_ALIGN_INT64 platforms
++ (hppa and sparc in Debian). */
++
++#ifdef ARCH_ALIGN_INT64
++#include <caml/memory.h>
++#include <caml/alloc.h>
++#define fastpath3(size,endian,signed,type,rval) \
++ CAMLprim value \
++ ocaml_bitstring_extract_fastpath_int##size##_##endian##_##signed \
++ (value strv, value offv, value rv) \
++ { \
++ CAMLparam3(strv, offv, rv); \
++ type *ptr = (type *) ((void *) String_val (strv) + Int_val (offv)); \
++ type r; \
++ r = *ptr; \
++ swap_##endian(size,r); \
++ CAMLreturn(caml_copy_int64(r)); \
++ }
++
++#else
++#define fastpath3 fastpath2
++#endif
++
++fastpath3(64,be,unsigned,uint64_t,Int64_val)
++fastpath3(64,le,unsigned,uint64_t,Int64_val)
++fastpath3(64,ne,unsigned,uint64_t,Int64_val)
++fastpath3(64,be,signed,int64_t,Int64_val)
++fastpath3(64,le,signed,int64_t,Int64_val)
++fastpath3(64,ne,signed,int64_t,Int64_val)
diff --git a/debian/patches/series b/debian/patches/series
index ddc2975..73aa2f5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ no-camlp4of-opt.patch
add_dynlink.patch
01-byte-compilation.dpatch
update-configure.patch
+fix_ARCH_ALIGN_INT64.dpatch
--
ocaml-bitstring packaging
More information about the Pkg-ocaml-maint-commits
mailing list